home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update25.zoo / gcc / diffs
Encoding:
Text File  |  1992-10-09  |  96.8 KB  |  3,133 lines

  1. *** 1.6    1992/08/14 15:10:24
  2. --- PatchLev.h    1992/10/09 20:08:47
  3. ***************
  4. *** 1,4 ****
  5. ! #define PatchLevel "3"
  6.   
  7.   /*
  8.    *    the Patch Level above is to identify the version
  9. --- 1,4 ----
  10. ! #define PatchLevel "4"
  11.   
  12.   /*
  13.    *    the Patch Level above is to identify the version
  14. *** 1.2    1992/06/11 23:40:40
  15. --- c-convert.c    1992/10/09 20:08:57
  16. ***************
  17. *** 232,242 ****
  18.             {
  19.               /* Don't do unsigned arithmetic where signed was wanted,
  20.                  or vice versa.
  21. !                Exception: if either of the original operands were
  22.                  unsigned then can safely do the work as unsigned.
  23.                  And we may need to do it as unsigned
  24.                  if we truncate to the original size.  */
  25. !             typex = ((TREE_UNSIGNED (TREE_TYPE (expr))
  26.                     || TREE_UNSIGNED (TREE_TYPE (arg0))
  27.                     || TREE_UNSIGNED (TREE_TYPE (arg1)))
  28.                    ? unsigned_type (typex) : signed_type (typex));
  29. --- 232,247 ----
  30.             {
  31.               /* Don't do unsigned arithmetic where signed was wanted,
  32.                  or vice versa.
  33. !                Exception 1: if we will eventually truncate
  34. !                the result to unsigned, then do the work as unsigned;
  35. !                this can prevent unnecessary sign-extension.
  36. !                Exception 2: if either of the original operands were
  37.                  unsigned then can safely do the work as unsigned.
  38.                  And we may need to do it as unsigned
  39.                  if we truncate to the original size.  */
  40. !             typex = (((outprec <= TYPE_PRECISION (typex)
  41. !                    && TREE_UNSIGNED (type))
  42. !                   || TREE_UNSIGNED (TREE_TYPE (expr))
  43.                     || TREE_UNSIGNED (TREE_TYPE (arg0))
  44.                     || TREE_UNSIGNED (TREE_TYPE (arg1)))
  45.                    ? unsigned_type (typex) : signed_type (typex));
  46. ***************
  47. *** 284,290 ****
  48.             {
  49.           /* Don't do unsigned arithmetic where signed was wanted,
  50.              or vice versa.  */
  51. !         typex = (TREE_UNSIGNED (TREE_TYPE (expr))
  52.                ? unsigned_type (typex) : signed_type (typex));
  53.           return convert (type,
  54.                   build_unary_op (ex_form,
  55. --- 289,297 ----
  56.             {
  57.           /* Don't do unsigned arithmetic where signed was wanted,
  58.              or vice versa.  */
  59. !         typex = (((outprec <= TYPE_PRECISION (typex)
  60. !                && TREE_UNSIGNED (type))
  61. !               || TREE_UNSIGNED (TREE_TYPE (expr)))
  62.                ? unsigned_type (typex) : signed_type (typex));
  63.           return convert (type,
  64.                   build_unary_op (ex_form,
  65. ***************
  66. *** 327,333 ****
  67.             {
  68.               /* Don't do unsigned arithmetic where signed was wanted,
  69.                  or vice versa.  */
  70. !             typex = (TREE_UNSIGNED (TREE_TYPE (expr))
  71.                    ? unsigned_type (typex) : signed_type (typex));
  72.               return convert (type,
  73.                       fold (build (COND_EXPR, typex,
  74. --- 334,342 ----
  75.             {
  76.               /* Don't do unsigned arithmetic where signed was wanted,
  77.                  or vice versa.  */
  78. !             typex = (((outprec <= TYPE_PRECISION (typex)
  79. !                    && TREE_UNSIGNED (type))
  80. !                   || TREE_UNSIGNED (TREE_TYPE (expr)))
  81.                    ? unsigned_type (typex) : signed_type (typex));
  82.               return convert (type,
  83.                       fold (build (COND_EXPR, typex,
  84. *** 1.6    1992/06/12 05:28:49
  85. --- c-decl.c    1992/10/09 20:08:58
  86. ***************
  87. *** 298,303 ****
  88. --- 298,307 ----
  89.          whose TREE_VALUE is its old definition (a kind of ..._DECL node).  */
  90.       tree shadowed;
  91.   
  92. +     /* For a memorable binding_level, a pointer to the BLOCK node associated
  93. +        which this binding_level at the time it was originally exited.  */
  94. +     tree associated_block;
  95.       /* For each level (except not the global one),
  96.          a chain of BLOCK nodes for all the levels
  97.          that were entered and exited one level down.  */
  98. ***************
  99. *** 333,338 ****
  100. --- 337,346 ----
  101.          not including any forward-decls in the parmlist.
  102.          This is so we can put the parms in proper order for assign_parms.  */
  103.       tree parm_order;
  104. +     /* Nonzero if we should keep this binding_level record around
  105. +        even after it looks like we no longer need it.  */
  106. +     unsigned memorable : 1;
  107.     };
  108.   
  109.   #define NULL_BINDING_LEVEL (struct binding_level *) NULL
  110. ***************
  111. *** 852,862 ****
  112.        or if this level is a function body,
  113.        create a BLOCK to record them for the life of this function.  */
  114.   
  115. !   if (keep || functionbody
  116.         || (current_binding_level->keep_if_subblocks && subblocks != 0))
  117.       block = build_block (keep ? decls : 0, keep ? tags : 0,
  118.                subblocks, 0, 0);
  119.   
  120.     /* In each subblock, record that this is its superior.  */
  121.   
  122.     for (link = subblocks; link; link = TREE_CHAIN (link))
  123. --- 860,872 ----
  124.        or if this level is a function body,
  125.        create a BLOCK to record them for the life of this function.  */
  126.   
  127. !   if (keep || functionbody || current_binding_level->memorable
  128.         || (current_binding_level->keep_if_subblocks && subblocks != 0))
  129.       block = build_block (keep ? decls : 0, keep ? tags : 0,
  130.                subblocks, 0, 0);
  131.   
  132. +   current_binding_level->associated_block = block;
  133.     /* In each subblock, record that this is its superior.  */
  134.   
  135.     for (link = subblocks; link; link = TREE_CHAIN (link))
  136. ***************
  137. *** 926,939 ****
  138.       }
  139.       }
  140.   
  141. !   /* Pop the current level, and free the structure for reuse.  */
  142.   
  143.     {
  144.       register struct binding_level *level = current_binding_level;
  145.       current_binding_level = current_binding_level->level_chain;
  146.   
  147. !     level->level_chain = free_binding_level;
  148. !     free_binding_level = level;
  149.     }
  150.   
  151.     /* Dispose of the block that we just made inside some higher level.  */
  152. --- 936,953 ----
  153.       }
  154.       }
  155.   
  156. !   /* Pop the current level, and free the structure for reuse unless it is
  157. !      marked as being "memorable".  */
  158.   
  159.     {
  160.       register struct binding_level *level = current_binding_level;
  161.       current_binding_level = current_binding_level->level_chain;
  162.   
  163. !     if (!level->memorable)
  164. !       {
  165. !     level->level_chain = free_binding_level;
  166. !     free_binding_level = level;
  167. !       }
  168.     }
  169.   
  170.     /* Dispose of the block that we just made inside some higher level.  */
  171. ***************
  172. *** 976,981 ****
  173. --- 990,1045 ----
  174.     if (block)
  175.       TREE_USED (block) = 1;
  176.     return block;
  177. + }
  178. + /* Mark the current binding level as "memorable" and return a pointer to it.
  179. +    The pointer returned can be used to restore this context later (if that
  180. +    proves to be necessary).  Also mark the rest of the binding_levels in
  181. +    the currently active binding_level chain as "memorable" so that they
  182. +    wont disappear on us when they are later deactivated (upon exit from
  183. +    the scopes which they represent).  */
  184. + struct binding_level *
  185. + current_memorable_context ()
  186. + {
  187. +   register struct binding_level *level;
  188. +   for (level = current_binding_level; level; level = level->level_chain)
  189. +     level->memorable = 1;
  190. +   return current_binding_level;
  191. + }
  192. + /* Given a pointer to an old (memorable) binding_level record which was
  193. +    previously created, activated, and then deactivated, activate the
  194. +    binding_level again (temporarily) so that we can generate some more
  195. +    code (e.g. for a goto_fixup) and make it look like it was generated
  196. +    in the given binding_level during the time when that binding_level
  197. +    was first active.  */
  198. + void
  199. + push_old_context (context)
  200. +      register struct binding_level *context;
  201. + {
  202. +   context->level_chain = current_binding_level;
  203. +   current_binding_level = context;
  204. + }
  205. + /* Assuming that the most recently activated binding_level was an old
  206. +    (memorable) binding_level which was temporarily reactivated, deactivate
  207. +    it again.  Also, take note of any new subblocks which have been generated
  208. +    during the time this old binding_level has been reactivated.  */
  209. + void
  210. + pop_old_context ()
  211. + {
  212. +   /* New subblocks may have been added, so remember again what the list of
  213. +      subblocks for this block is.  */
  214. +   BLOCK_SUBBLOCKS (current_binding_level->associated_block)
  215. +     = current_binding_level->blocks;
  216. +   current_binding_level = current_binding_level->level_chain;
  217.   }
  218.   
  219.   void
  220. *** 1.3    1992/06/11 23:40:40
  221. --- c-parse.y    1992/10/09 20:09:00
  222. ***************
  223. *** 329,335 ****
  224.           { $$ = $3;
  225.             pedantic = $<itype>1; }
  226.       | unop cast_expr  %prec UNARY
  227. !         { $$ = build_unary_op ($1, $2, 0); }
  228.       /* Refer to the address of a label as a pointer.  */
  229.       | ANDAND identifier
  230.           { tree label = lookup_label ($2);
  231. --- 329,336 ----
  232.           { $$ = $3;
  233.             pedantic = $<itype>1; }
  234.       | unop cast_expr  %prec UNARY
  235. !         { $$ = build_unary_op ($1, $2, 0);
  236. !           constant_expression_warning ($$, 0); }
  237.       /* Refer to the address of a label as a pointer.  */
  238.       | ANDAND identifier
  239.           { tree label = lookup_label ($2);
  240. *** 1.2    1992/03/27 21:49:26
  241. --- c-tree.h    1992/10/09 20:09:00
  242. ***************
  243. *** 107,112 ****
  244. --- 107,113 ----
  245.   extern tree digest_init ();
  246.   extern tree c_expand_start_case ();
  247.   extern tree default_conversion ();
  248. + extern void constant_expression_warning ();
  249.   
  250.   /* Given two integer or real types, return the type for their sum.
  251.      Given two compatible ANSI C types, returns the merged type.  */
  252. *** 1.4    1992/06/11 23:40:40
  253. --- c-typeck.c    1992/10/09 20:09:01
  254. ***************
  255. *** 784,797 ****
  256.   }
  257.   
  258.   /* Print a warning if a constant expression had overflow in folding.
  259. !    This doesn't really work--it is waiting for changes in fold.  */
  260.   
  261.   void
  262. ! constant_expression_warning (value)
  263.        tree value;
  264.   {
  265. !   if (TREE_CODE (value) == NON_LVALUE_EXPR && TREE_CONSTANT_OVERFLOW (value))
  266. !     pedwarn ("overflow in constant expression");
  267.   }
  268.   
  269.   /* Implement the __alignof keyword: Return the minimum required
  270. --- 784,805 ----
  271.   }
  272.   
  273.   /* Print a warning if a constant expression had overflow in folding.
  274. !    If EVEN_IF_UNSIGNED is nonzero, warn even if the expression is unsigned.  */
  275.   
  276.   void
  277. ! constant_expression_warning (value, even_if_unsigned)
  278.        tree value;
  279. +      int even_if_unsigned;
  280.   {
  281. !   if (TREE_CODE (value) == INTEGER_CST
  282. !       && TREE_CONSTANT_OVERFLOW (value)
  283. !       && (! TREE_UNSIGNED (TREE_TYPE (value)) || even_if_unsigned))
  284. !     {
  285. !       TREE_CONSTANT_OVERFLOW (value) = 0;
  286. !       pedwarn (TREE_UNSIGNED (TREE_TYPE (value))
  287. !            ? "constant expression out of range for unsigned type"
  288. !            : "signed integer overflow in constant expression");
  289. !     }
  290.   }
  291.   
  292.   /* Implement the __alignof keyword: Return the minimum required
  293. ***************
  294. *** 2128,2133 ****
  295. --- 2136,2143 ----
  296.       }
  297.       }
  298.   
  299. +   constant_expression_warning (result, 0);
  300.     class = TREE_CODE_CLASS (TREE_CODE (result));
  301.   
  302.     /* Record the code that was specified in the source,
  303. ***************
  304. *** 3719,3724 ****
  305. --- 3729,3735 ----
  306.       warning ("cast to pointer from integer of different size");
  307.   
  308.         value = convert (type, value);
  309. +       constant_expression_warning (value, 0);
  310.       }
  311.   
  312.     if (value == expr && pedantic)
  313. ***************
  314. *** 3937,3943 ****
  315.          &&
  316.         (coder == INTEGER_TYPE || coder == REAL_TYPE || coder == ENUMERAL_TYPE))
  317.       {
  318. !       return convert (type, rhs);
  319.       }
  320.     /* Conversions among pointers */
  321.     else if (codel == POINTER_TYPE && coder == POINTER_TYPE)
  322. --- 3948,3956 ----
  323.          &&
  324.         (coder == INTEGER_TYPE || coder == REAL_TYPE || coder == ENUMERAL_TYPE))
  325.       {
  326. !       tree t = convert (type, rhs);
  327. !       constant_expression_warning (t, 1);
  328. !       return t;
  329.       }
  330.     /* Conversions among pointers */
  331.     else if (codel == POINTER_TYPE && coder == POINTER_TYPE)
  332. ***************
  333. *** 4224,4230 ****
  334.   #endif
  335.   
  336.     /* ANSI wants warnings about out-of-range constant initializers.  */
  337. !   constant_expression_warning (value);
  338.   
  339.     DECL_INITIAL (decl) = value;
  340.   }
  341. --- 4237,4243 ----
  342.   #endif
  343.   
  344.     /* ANSI wants warnings about out-of-range constant initializers.  */
  345. !   constant_expression_warning (value, 1);
  346.   
  347.     DECL_INITIAL (decl) = value;
  348.   }
  349. *** 1.9    1992/07/07 14:31:13
  350. --- cccp.c    1992/10/09 20:09:03
  351. ***************
  352. *** 1545,1555 ****
  353.       }
  354.       if (e1) {
  355.           if (db_hack) {
  356. ! #ifdef atarist
  357. !         strcat (epath, ",");
  358. ! #else
  359. !         strcat (epath, ":");
  360. ! #endif
  361.           }
  362.           strcat (epath, e1);
  363.           db_hack = 1;
  364. --- 1545,1551 ----
  365.       }
  366.       if (e1) {
  367.           if (db_hack) {
  368. !         strcat (epath, PATH_SEP_STR);
  369.           }
  370.           strcat (epath, e1);
  371.           db_hack = 1;
  372. ***************
  373. *** 1556,1571 ****
  374.       }
  375.       if (e2) {
  376.           if (db_hack) {
  377. ! #ifdef atarist
  378. !         strcat (epath, ",");
  379. ! #else
  380. !         strcat (epath, ":");
  381. ! #endif
  382.           }
  383.           strcat (epath, e2);
  384.       }
  385.       }
  386.   
  387.   #else
  388.       switch ((objc << 1) + cplusplus)
  389.       {
  390. --- 1552,1569 ----
  391.       }
  392.       if (e2) {
  393.           if (db_hack) {
  394. !         strcat (epath, PATH_SEP_STR);
  395.           }
  396.           strcat (epath, e2);
  397.       }
  398.       }
  399.   
  400. + #ifdef atarist
  401. +     if (epath)
  402. +         for (e3=epath; *e3; e3++)    /* Use one kind of path separator */
  403. +         if (*e3 == ';')
  404. +         *e3 = PATH_SEPARATOR;
  405. + #endif
  406.   #else
  407.       switch ((objc << 1) + cplusplus)
  408.       {
  409. ***************
  410. *** 1592,1602 ****
  411.         char *startp, *endp;
  412.   
  413.         for (num_dirs = 1, startp = epath; *startp; startp++)
  414. - #ifdef atarist
  415. -     if ((*startp == ';') || (*startp == ','))
  416. - #else
  417.       if (*startp == PATH_SEPARATOR)
  418. - #endif
  419.         num_dirs++;
  420.         include_defaults
  421.       = (struct default_include *) xmalloc ((num_dirs
  422. --- 1590,1596 ----
  423. ***************
  424. *** 1606,1612 ****
  425.         num_dirs = 0;
  426.         while (1) {
  427.           /* Handle cases like c:/usr/lib:d:/gcc/lib */
  428. - #ifndef atarist
  429.           if ((*endp == PATH_SEPARATOR
  430.   #if 0 /* Obsolete, now that we use semicolons as the path separator.  */
  431.   #ifdef __MSDOS__
  432. --- 1600,1605 ----
  433. ***************
  434. *** 1615,1623 ****
  435.   #endif
  436.            )
  437.               || *endp == 0) {
  438. - #else
  439. -     if ((*endp == ';') || (*endp == ',') || (*endp == '\0')) {
  440. - #endif
  441.         strncpy (nstore, startp, endp-startp);
  442.         if (endp == startp)
  443.           strcpy (nstore, ".");
  444. --- 1608,1613 ----
  445. ***************
  446. *** 1644,1654 ****
  447.        tack on the standard include file dirs to the specified list */
  448.     if (!no_standard_includes) {
  449.       struct default_include *p = include_defaults;
  450. - #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  451. -     char *specd_prefix = NULL;
  452. - #else
  453.       char *specd_prefix = include_prefix;
  454. - #endif
  455.   #ifdef GCC_INCLUDE_DIR
  456.       char *default_prefix = savestring (GCC_INCLUDE_DIR);
  457.   #else
  458. --- 1634,1640 ----
  459. *** 1.3    1992/06/11 23:40:40
  460. --- combine.c    1992/10/09 20:09:05
  461. ***************
  462. *** 4987,4993 ****
  463.           {
  464.             varop = plus_constant (XEXP (varop, 0),
  465.                        INTVAL (XEXP (varop, 1)) & constop);
  466. !           constop = ~0;
  467.             break;
  468.           }
  469.   
  470. --- 4987,4993 ----
  471.           {
  472.             varop = plus_constant (XEXP (varop, 0),
  473.                        INTVAL (XEXP (varop, 1)) & constop);
  474. !           constop = (unsigned) ~0;
  475.             break;
  476.           }
  477.   
  478. *** 1.4    1992/06/11 23:40:40
  479. --- cp-class.c    1992/10/09 20:09:07
  480. ***************
  481. *** 2520,2526 ****
  482.   
  483.         if (! fields) fields = x;
  484.         DECL_FIELD_CONTEXT (x) = t;
  485. !       DECL_CLASS_CONTEXT (x) = t;
  486.         DECL_FIELD_SIZE (x) = 0;
  487.   
  488.         /* We set DECL_BIT_FIELD tentatively in grokbitfield.
  489. --- 2520,2528 ----
  490.   
  491.         if (! fields) fields = x;
  492.         DECL_FIELD_CONTEXT (x) = t;
  493. !       /* We could be making an extern "C" function a friend. */
  494. !       if (DECL_LANG_SPECIFIC (x))
  495. !         DECL_CLASS_CONTEXT (x) = t;
  496.         DECL_FIELD_SIZE (x) = 0;
  497.   
  498.         /* We set DECL_BIT_FIELD tentatively in grokbitfield.
  499. *** 1.4    1992/06/11 23:40:40
  500. --- cp-cvt.c    1992/10/09 20:09:08
  501. ***************
  502. *** 831,842 ****
  503.             {
  504.               /* Don't do unsigned arithmetic where signed was wanted,
  505.                  or vice versa.
  506. !                Exception: if the original operands were unsigned
  507. !                then can safely do the work as unsigned.
  508.                  And we may need to do it as unsigned
  509.                  if we truncate to the original size.  */
  510. !             typex = ((TREE_UNSIGNED (TREE_TYPE (expr))
  511. !                   || TREE_UNSIGNED (TREE_TYPE (arg0)))
  512.                    ? unsigned_type (typex) : signed_type (typex));
  513.               return convert (type,
  514.                       build_binary_op_nodefault (ex_form,
  515. --- 831,848 ----
  516.             {
  517.               /* Don't do unsigned arithmetic where signed was wanted,
  518.                  or vice versa.
  519. !                Exception 1: if we will eventually truncate
  520. !                the result, then do the work as unsigned;
  521. !                this can prevent unnecessary sign-extension.
  522. !                Exception 2: if either of the original operands were
  523. !                unsigned then can safely do the work as unsigned.
  524.                  And we may need to do it as unsigned
  525.                  if we truncate to the original size.  */
  526. !             typex = (((outprec <= TYPE_PRECISION (typex)
  527. !                    && TREE_UNSIGNED (type))
  528. !                   || TREE_UNSIGNED (TREE_TYPE (expr))
  529. !                   || TREE_UNSIGNED (TREE_TYPE (arg0))
  530. !                   || TREE_UNSIGNED (TREE_TYPE (arg1)))
  531.                    ? unsigned_type (typex) : signed_type (typex));
  532.               return convert (type,
  533.                       build_binary_op_nodefault (ex_form,
  534. ***************
  535. *** 883,889 ****
  536.             {
  537.           /* Don't do unsigned arithmetic where signed was wanted,
  538.              or vice versa.  */
  539. !         typex = (TREE_UNSIGNED (TREE_TYPE (expr))
  540.                ? unsigned_type (typex) : signed_type (typex));
  541.           return convert (type,
  542.                   build_unary_op (ex_form,
  543. --- 889,897 ----
  544.             {
  545.           /* Don't do unsigned arithmetic where signed was wanted,
  546.              or vice versa.  */
  547. !         typex = (((outprec <= TYPE_PRECISION (typex)
  548. !                && TREE_UNSIGNED (type))
  549. !               || TREE_UNSIGNED (TREE_TYPE (expr)))
  550.                ? unsigned_type (typex) : signed_type (typex));
  551.           return convert (type,
  552.                   build_unary_op (ex_form,
  553. ***************
  554. *** 926,932 ****
  555.             {
  556.               /* Don't do unsigned arithmetic where signed was wanted,
  557.                  or vice versa.  */
  558. !             typex = (TREE_UNSIGNED (TREE_TYPE (expr))
  559.                    ? unsigned_type (typex) : signed_type (typex));
  560.               return convert (type,
  561.                       fold (build (COND_EXPR, typex,
  562. --- 934,942 ----
  563.             {
  564.               /* Don't do unsigned arithmetic where signed was wanted,
  565.                  or vice versa.  */
  566. !             typex = (((outprec <= TYPE_PRECISION (typex)
  567. !                    && TREE_UNSIGNED (type))
  568. !                   || TREE_UNSIGNED (TREE_TYPE (expr)))
  569.                    ? unsigned_type (typex) : signed_type (typex));
  570.               return convert (type,
  571.                       fold (build (COND_EXPR, typex,
  572. *** 1.3    1992/06/11 23:40:40
  573. --- cp-decl.c    1992/10/09 20:09:09
  574. ***************
  575. *** 535,540 ****
  576. --- 535,544 ----
  577.       /* Same, for IDENTIFIER_TYPE_VALUE.  */
  578.       tree type_shadowed;
  579.   
  580. +     /* For a memorable binding_level, a pointer to the BLOCK node associated
  581. +        which this binding_level at the time it was originally exited.  */
  582. +     tree associated_block;
  583.       /* For each level (except not the global one),
  584.          a chain of BLOCK nodes for all the levels
  585.          that were entered and exited one level down.  */
  586. ***************
  587. *** 573,578 ****
  588. --- 577,586 ----
  589.          this scope.  This happens in some template definitions.  */
  590.       unsigned accept_any : 1;
  591.   
  592. +     /* Nonzero if we should keep this binding_level record around
  593. +        even after it looks like we no longer need it.  */
  594. +     unsigned memorable : 1;
  595.       /* Three bits left for this word.  */
  596.   
  597.   #if PARANOID
  598. ***************
  599. *** 698,713 ****
  600.     /* Pop the current level, and free the structure for reuse.  */
  601.     {
  602.       register struct binding_level *level = current_binding_level;
  603.       current_binding_level = current_binding_level->level_chain;
  604. !     level->level_chain = free_binding_level;
  605.   #ifdef DEBUG_CP_BINDING_LEVELS
  606. !     memset (level, 0x69, sizeof (*level));
  607.   #else
  608. !     free_binding_level = level;
  609.   #if PARANOID
  610. !     level->depth = ~0;    /* ~0 assumes that the depth is unsigned. */
  611.   #endif
  612.   #endif
  613.       if (current_binding_level->parm_flag == 2)
  614.         {
  615.       class_binding_level = current_binding_level;
  616. --- 706,736 ----
  617.     /* Pop the current level, and free the structure for reuse.  */
  618.     {
  619.       register struct binding_level *level = current_binding_level;
  620. +     /* Pop the stack of current "active" binding_level records.  */
  621.       current_binding_level = current_binding_level->level_chain;
  622. !     /* If the binding_level which we just made inactive is *not* a
  623. !        "memorable" binding_level, then throw it back onto the recycling
  624. !        pile of old binding_level records.  Otherwise, just let it be.
  625. !        If it was marked as "memorable" then some goto_fixup saved a
  626. !        a pointer to it, and the binding_level record will be used later
  627. !        on to restore the same lexical context again (temporarily).   */
  628. !     if (!level->memorable)
  629. !       {
  630. !         level->level_chain = free_binding_level;
  631.   #ifdef DEBUG_CP_BINDING_LEVELS
  632. !         memset (level, 0x69, sizeof (*level));
  633.   #else
  634. !         free_binding_level = level;
  635.   #if PARANOID
  636. !         level->depth = ~0;    /* ~0 assumes that the depth is unsigned. */
  637.   #endif
  638.   #endif
  639. +       }
  640.       if (current_binding_level->parm_flag == 2)
  641.         {
  642.       class_binding_level = current_binding_level;
  643. ***************
  644. *** 740,747 ****
  645.   int
  646.   kept_level_p ()
  647.   {
  648. !   return (current_binding_level->keep
  649. !       || current_binding_level->names != 0);
  650.   }
  651.   
  652.   /* Identify this binding level as a level of parameters.  */
  653. --- 763,773 ----
  654.   int
  655.   kept_level_p ()
  656.   {
  657. !   return (current_binding_level->blocks != 0
  658. !       || current_binding_level->keep
  659. !       || current_binding_level->names != 0
  660. !       || (current_binding_level->tags != 0
  661. !           && !current_binding_level->tag_transparent));
  662.   }
  663.   
  664.   /* Identify this binding level as a level of parameters.  */
  665. ***************
  666. *** 950,959 ****
  667.        or if this level is a function body,
  668.        create a BLOCK to record them for the life of this function.  */
  669.   
  670. !   if (keep == 1 || functionbody > 0)
  671.       block = build_block (keep ? decls : 0, keep ? tags : 0,
  672.                subblocks, 0, 0);
  673.   
  674.     /* In each subblock, record that this is its superior.  */
  675.   
  676.     if (keep >= 0)
  677. --- 976,987 ----
  678.        or if this level is a function body,
  679.        create a BLOCK to record them for the life of this function.  */
  680.   
  681. !   if (keep == 1 || functionbody > 0 || current_binding_level->memorable)
  682.       block = build_block (keep ? decls : 0, keep ? tags : 0,
  683.                subblocks, 0, 0);
  684.   
  685. +   current_binding_level->associated_block = block;
  686.     /* In each subblock, record that this is its superior.  */
  687.   
  688.     if (keep >= 0)
  689. ***************
  690. *** 1080,1085 ****
  691. --- 1108,1163 ----
  692.   #endif
  693.     return block;
  694.   }
  695. + /* Mark the current binding level as "memorable" and return a pointer to it.
  696. +    The pointer returned can be used to restore this context later (if that
  697. +    proves to be necessary).  Also mark the rest of the binding_levels in
  698. +    the currently active binding_level chain as "memorable" so that they
  699. +    wont disappear on us when they are later deactivated (upon exit from
  700. +    the scopes which they represent).  */
  701. + struct binding_level *
  702. + current_memorable_context ()
  703. + {
  704. +   register struct binding_level *level;
  705. +   for (level = current_binding_level; level; level = level->level_chain)
  706. +     level->memorable = 1;
  707. +   return current_binding_level;
  708. + }
  709. + /* Given a pointer to an old (memorable) binding_level record which was
  710. +    previously created, activated, and then deactivated, activate the
  711. +    binding_level again (temporarily) so that we can generate some more
  712. +    code (e.g. for a goto_fixup) and make it look like it was generated
  713. +    in the given binding_level during the time when that binding_level
  714. +    was first active.  */
  715. + void
  716. + push_old_context (context)
  717. +      register struct binding_level *context;
  718. + {
  719. +   context->level_chain = current_binding_level;
  720. +   current_binding_level = context;
  721. + }
  722. + /* Assuming that the most recently activated binding_level was an old
  723. +    (memorable) binding_level which was temporarily reactivated, deactivate
  724. +    it again.  Also, take note of any new subblocks which have been generated
  725. +    during the time this old binding_level has been reactivated.  */
  726. + void
  727. + pop_old_context ()
  728. + {
  729. +   /* New subblocks may have been added, so remember again what the list of
  730. +      subblocks for this block is.  */
  731. +   BLOCK_SUBBLOCKS (current_binding_level->associated_block)
  732. +     = current_binding_level->blocks;
  733. +   current_binding_level = current_binding_level->level_chain;
  734. + }
  735.   
  736.   /* Add BLOCK to the current list of blocks for this binding contour.  */
  737.   void
  738. ***************
  739. *** 6215,6221 ****
  740.     int funcdef_flag = 0;
  741.     enum tree_code innermost_code = ERROR_MARK;
  742.     int bitfield = 0;
  743. !   int variable_size = 0;
  744.     /* Set this to error_mark_node for FIELD_DECLs we could not handle properly.
  745.        All FIELD_DECLs we build here have `init' put into their DECL_INITIAL.  */
  746.     tree init = 0;
  747. --- 6293,6299 ----
  748.     int funcdef_flag = 0;
  749.     enum tree_code innermost_code = ERROR_MARK;
  750.     int bitfield = 0;
  751. !   int size_varies = 0;
  752.     /* Set this to error_mark_node for FIELD_DECLs we could not handle properly.
  753.        All FIELD_DECLs we build here have `init' put into their DECL_INITIAL.  */
  754.     tree init = 0;
  755. ***************
  756. *** 7085,7090 ****
  757. --- 7163,7172 ----
  758.                 pedwarn ("ANSI C++ forbids variable-size array `%s'", name);
  759.             dont_grok_size:
  760.               itype = build_binary_op (MINUS_EXPR, size, integer_one_node);
  761. +             /* Make sure the array size remains visibly nonconstant
  762. +                even if it is (eg) a const variable with known value.  */
  763. +             size_varies = 1;
  764. +             itype = variable_size (itype);
  765.               itype = build_index_type (itype);
  766.             }
  767.           resume_momentary (yes);
  768. ***************
  769. *** 10110,10132 ****
  770.         && TREE_CHAIN (DECL_ARGUMENTS (fndecl)) != NULL_TREE)
  771.       build_default_constructor (fndecl);
  772.   
  773. !       /* Emit insns from `emit_base_init' which sets up virtual
  774. !      function table pointer(s).  */
  775. !       emit_insns (base_init_insns);
  776. !       base_init_insns = 0;
  777. !       /* This is where the body of the constructor begins.
  778. !      If there were no insns in this function body, then the
  779. !      last_parm_insn is also the last insn.
  780. !      If optimization is enabled, last_parm_insn may move, so
  781. !      we don't hold on to it (across emit_base_init).  */
  782. !       last_parm_insn = (struct rtx_def *)get_first_nonparm_insn ();
  783. !       if (last_parm_insn == 0) last_parm_insn = mark;
  784. !       else last_parm_insn = (struct rtx_def *) previous_insn (last_parm_insn);
  785.   
  786. !       if (mark != get_last_insn ())
  787. !     reorder_insns (next_insn (mark), get_last_insn (), last_parm_insn);
  788.   
  789.         /* This is where the body of the constructor ends.  */
  790.         expand_label (ctor_label);
  791. --- 10192,10218 ----
  792.         && TREE_CHAIN (DECL_ARGUMENTS (fndecl)) != NULL_TREE)
  793.       build_default_constructor (fndecl);
  794.   
  795. !       /* Now attach the insns which do baseclass initializations (for a
  796. !      constructor) to the insn stream.  */
  797. !       {
  798. !     register struct rtx_def *attach_point;
  799.   
  800. !         /* This is where the body of the constructor begins.
  801. !        If there were no insns in this function body, then the
  802. !        attach_point is also the last insn.  */
  803. !         attach_point = (struct rtx_def *)get_first_nonparm_insn ();
  804. !         if (attach_point == 0)
  805. !       attach_point = mark;
  806. !     attach_point
  807. !       = (struct rtx_def *) get_first_following_block_beg (attach_point);
  808. !         /* Emit insns from `emit_base_init' which sets up virtual
  809. !        function table pointer(s).  */
  810. !         emit_insns_after (base_init_insns, attach_point);
  811. !         base_init_insns = 0;
  812. !       }
  813.   
  814.         /* This is where the body of the constructor ends.  */
  815.         expand_label (ctor_label);
  816. *** 1.3    1992/06/11 23:40:40
  817. --- cp-init.c    1992/10/09 20:09:13
  818. ***************
  819. *** 258,264 ****
  820.             /* Virtual base classes are special cases.  Their initializers
  821.            are recorded with this constructor, and they are used when
  822.            this constructor is the top-level constructor called.  */
  823. !           if (! TREE_VIA_VIRTUAL (binfo) || pedantic)
  824.           {
  825.             /* Otherwise, if it is not an immediate base class, complain.  */
  826.             for (i = n_baseclasses-1; i >= 0; i--)
  827. --- 258,264 ----
  828.             /* Virtual base classes are special cases.  Their initializers
  829.            are recorded with this constructor, and they are used when
  830.            this constructor is the top-level constructor called.  */
  831. !           if (! TREE_VIA_VIRTUAL (binfo))
  832.           {
  833.             /* Otherwise, if it is not an immediate base class, complain.  */
  834.             for (i = n_baseclasses-1; i >= 0; i--)
  835. *** 1.3    1992/06/11 23:40:40
  836. --- cp-tree.h    1992/10/09 20:09:19
  837. ***************
  838. *** 1405,1411 ****
  839.   
  840.   #define JOINER '$'
  841.   
  842. ! #define THIS_NAME "$t"
  843.   #define VPTR_NAME "$v"
  844.   #define THROW_NAME "$eh_throw"
  845.   #define DESTRUCTOR_DECL_PREFIX "_$_"
  846. --- 1405,1411 ----
  847.   
  848.   #define JOINER '$'
  849.   
  850. ! #define THIS_NAME "this"
  851.   #define VPTR_NAME "$v"
  852.   #define THROW_NAME "$eh_throw"
  853.   #define DESTRUCTOR_DECL_PREFIX "_$_"
  854. ***************
  855. *** 1432,1438 ****
  856.   
  857.   #define JOINER '.'
  858.   
  859. ! #define THIS_NAME ".t"
  860.   #define VPTR_NAME ".v"
  861.   #define THROW_NAME ".eh_throw"
  862.   #define DESTRUCTOR_DECL_PREFIX "_._"
  863. --- 1432,1438 ----
  864.   
  865.   #define JOINER '.'
  866.   
  867. ! #define THIS_NAME "this"
  868.   #define VPTR_NAME ".v"
  869.   #define THROW_NAME ".eh_throw"
  870.   #define DESTRUCTOR_DECL_PREFIX "_._"
  871. *** 1.8    1992/07/21 15:34:14
  872. --- dbxout.c    1992/10/09 20:09:23
  873. ***************
  874. *** 142,150 ****
  875.   #if defined (USG) || defined (NO_STAB_H)
  876.   #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  877.   #else
  878. - #if defined(CROSSATARI) || defined(atarist) || defined(atariminix)
  879. - #include "astab.h"
  880. - #else
  881.   #include <stab.h>  /* On BSD, use the system's stab.h.  */
  882.   
  883.   /* This is a GNU extension we need to reference in this file.  */
  884. --- 142,147 ----
  885. ***************
  886. *** 152,158 ****
  887.   #define N_CATCH 0x54
  888.   #endif
  889.   #endif /* not USG */
  890. - #endif
  891.   
  892.   #ifdef __GNU_STAB__
  893.   #define STAB_CODE_TYPE enum __stab_debug_code
  894. --- 149,154 ----
  895. ***************
  896. *** 408,421 ****
  897.   #ifdef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
  898.         DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (asmfile, cwd);
  899.   #else /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
  900. - #ifndef atarist
  901.         fprintf (asmfile, "%s \"%s/\",%d,0,0,%s\n", ASM_STABS_OP,
  902.              cwd, N_SO, <ext_label_name[1]);
  903. - #else
  904. -     fprintf (asmfile, "%s \"", ASM_STABS_OP);
  905. -     atari_output_filename(asmfile, cwd);
  906. -     fprintf (asmfile, "\\\\\",%d,0,0,%s\n", N_SO, <ext_label_name[1]);
  907. - #endif
  908.   #endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
  909.       }
  910.       }
  911. --- 404,411 ----
  912. ***************
  913. *** 428,441 ****
  914.     /* We include outputting `Ltext:' here,
  915.        because that gives you a way to override it.  */
  916.     /* Used to put `Ltext:' before the reference, but that loses on sun 4.  */
  917. - #ifndef atarist
  918.     fprintf (asmfile, "%s \"%s\",%d,0,0,%s\n", ASM_STABS_OP, input_file_name,
  919.          N_SO, <ext_label_name[1]);
  920. - #else
  921. -   fprintf (asmfile, "%s \"", ASM_STABS_OP);
  922. -   atari_output_filename(asmfile, input_file_name);
  923. -   fprintf(asmfile, "\",%d,0,0,%s\n", N_SO, <ext_label_name[1]);
  924. - #endif
  925.     text_section ();
  926.     ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
  927.   #endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
  928. --- 418,425 ----
  929. ***************
  930. *** 501,514 ****
  931.         DBX_OUTPUT_SOURCE_FILENAME (file, filename);
  932.   #else
  933.         ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
  934. - #ifndef atarist
  935.         fprintf (file, "%s \"%s\",%d,0,0,%s\n", ASM_STABS_OP,
  936.              filename, N_SOL, <ext_label_name[1]);
  937. - #else
  938. -       fprintf (file, "%s \"", ASM_STABS_OP);
  939. -       atari_output_filename(file, filename);
  940. -       fprintf (file, "\",%d,0,0,%s\n", N_SOL, <ext_label_name[1]);
  941. - #endif
  942.   #endif
  943.         lastfile = filename;
  944.       }
  945. --- 485,492 ----
  946. *** 1.3    1992/06/11 23:40:40
  947. --- dwarfout.c    1992/10/09 20:09:28
  948. ***************
  949. *** 26,31 ****
  950. --- 26,32 ----
  951.   #include <stdio.h>
  952.   #include "dwarf.h"
  953.   #include "tree.h"
  954. + #include "cp-tree.h"
  955.   #include "flags.h"
  956.   #include "rtl.h"
  957.   #include "insn-config.h"
  958. ***************
  959. *** 84,89 ****
  960. --- 85,109 ----
  961.   #define ASM_COMMENT_START ";#"
  962.   #endif
  963.   
  964. + /* Given a pointer to some ..._DECL node, yield a pointer to the tree node
  965. +    which represents the scope within which the given decl actually appeared.
  966. +    This has to be messy (like it is) because in the special case of virtual
  967. +    functions in derived classes which were also declared in a base class,
  968. +    the g++ front end keeps the pointer to the *actual* scope of the decl
  969. +    representing the virtual member function in DECL_CLASS_CONTEXT rather
  970. +    than in DECL_CONTEXT (as it should).  This macro can be disposed of
  971. +    when the g++ front-end gets fixed to always put the proper value into
  972. +    the DECL_CONTEXT field (even for virtual functions declared in derived
  973. +    classes).  */
  974. + #define DECL_ACTUAL_CONTEXT(DECL) \
  975. +   ((gplusplus_trees \
  976. +       && DECL_LANG_SPECIFIC(DECL) != 0 \
  977. +       && TREE_CODE (DECL) == FUNCTION_DECL \
  978. +       && DECL_VIRTUAL_P (DECL)) \
  979. +     ? DECL_CLASS_CONTEXT(DECL) \
  980. +     : DECL_CONTEXT(DECL))
  981.   /* Define a macro which, when given a pointer to some BLOCK node, returns
  982.      a pointer to the FUNCTION_DECL node from which the given BLOCK node
  983.      was instantiated (as an inline expansion).  This macro needs to be
  984. ***************
  985. *** 170,175 ****
  986. --- 190,199 ----
  987.   
  988.   typedef struct filename_entry filename_entry;
  989.   
  990. + /* A flag which is non-zero if we being driven by the g++ front-end.  */
  991. + static int gplusplus_trees = 0;
  992.   /* Pointer to an array of elements, each one having the structure above. */
  993.   
  994.   static filename_entry *filename_table;
  995. ***************
  996. *** 750,755 ****
  997. --- 774,791 ----
  998.             && (REGNO (XEXP (rtl, 0)) >= FIRST_PSEUDO_REGISTER)));
  999.   }
  1000.   
  1001. + inline int
  1002. + is_class_type (arg)
  1003. +      register tree arg;
  1004. + {
  1005. +   register enum tree_code code;
  1006. +   if (!arg)
  1007. +     return 0;
  1008. +   code = TREE_CODE (arg);
  1009. +   return (code == RECORD_TYPE || code == UNION_TYPE);
  1010. + }
  1011.   static char *
  1012.   dwarf_tag_name (tag)
  1013.        register unsigned tag;
  1014. ***************
  1015. *** 1302,1309 ****
  1016.          Dwarf terminology we're dealing with here.  */
  1017.   
  1018.       ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
  1019. !         ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
  1020. !                 DBX_REGISTER_NUMBER (REGNO (rtl)));
  1021.       break;
  1022.   
  1023.         case MEM:
  1024. --- 1338,1348 ----
  1025.          Dwarf terminology we're dealing with here.  */
  1026.   
  1027.       ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
  1028. !     if (is_pseudo_reg (rtl))
  1029. !           ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) -1);
  1030. !     else
  1031. !           ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
  1032. !                   DBX_REGISTER_NUMBER (REGNO (rtl)));
  1033.       break;
  1034.   
  1035.         case MEM:
  1036. ***************
  1037. *** 1358,1365 ****
  1038.   
  1039.       case REG:
  1040.       ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
  1041. !         ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
  1042. !                 DBX_REGISTER_NUMBER (REGNO (rtl)));
  1043.       break;
  1044.   
  1045.       case MEM:
  1046. --- 1397,1407 ----
  1047.   
  1048.       case REG:
  1049.       ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
  1050. !     if (is_pseudo_reg (rtl))
  1051. !           ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) -1);
  1052. !     else
  1053. !           ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
  1054. !                   DBX_REGISTER_NUMBER (REGNO (rtl)));
  1055.       break;
  1056.   
  1057.       case MEM:
  1058. ***************
  1059. *** 2474,2496 ****
  1060.         /* Find the IDENTIFIER_NODE for the type name.  */
  1061.         if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
  1062.       t = TYPE_NAME (type);
  1063. ! #if 0
  1064.         /* The g++ front end makes the TYPE_NAME of *each* tagged type point
  1065.        to a TYPE_DECL node, regardless of whether or not a `typedef' was
  1066.        involved.  This is distinctly different from what the gcc front-end
  1067.        does.  It always makes the TYPE_NAME for each tagged type be either
  1068.        NULL (signifying an anonymous tagged type) or else a pointer to an
  1069. !      IDENTIFIER_NODE.  Obviously, we would like to generate correct Dwarf
  1070. !      for both C and C++, but given this inconsistency in the TREE
  1071. !      representation of tagged types for C and C++ in the GNU front-ends,
  1072. !      we cannot support both languages correctly unless we introduce some
  1073. !      front-end specific code here, and rms objects to that, so we can
  1074. !      only generate correct Dwarf for one of these two languages.  C is
  1075. !      more important, so for now we'll do the right thing for C and let
  1076. !      g++ go fish.  */
  1077.   
  1078.         else
  1079. !     if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
  1080.         t = DECL_NAME (TYPE_NAME (type));
  1081.   #endif
  1082.         /* Now get the name as a string, or invent one.  */
  1083. --- 2516,2534 ----
  1084.         /* Find the IDENTIFIER_NODE for the type name.  */
  1085.         if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
  1086.       t = TYPE_NAME (type);
  1087. ! #if 1
  1088.         /* The g++ front end makes the TYPE_NAME of *each* tagged type point
  1089.        to a TYPE_DECL node, regardless of whether or not a `typedef' was
  1090.        involved.  This is distinctly different from what the gcc front-end
  1091.        does.  It always makes the TYPE_NAME for each tagged type be either
  1092.        NULL (signifying an anonymous tagged type) or else a pointer to an
  1093. !      IDENTIFIER_NODE.  Obviously, we want to generate correct Dwarf
  1094. !      for both C and C++, but doing so requires us to check which source
  1095. !      language we are dealing with here.  */
  1096.   
  1097.         else
  1098. !     if (strcmp (language_string, "GNU C++") == 0
  1099. !         && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
  1100.         t = DECL_NAME (TYPE_NAME (type));
  1101.   #endif
  1102.         /* Now get the name as a string, or invent one.  */
  1103. ***************
  1104. *** 2667,2701 ****
  1105.       type_attribute (type, 0, 0);
  1106.   }
  1107.   
  1108. - /* Output a DIE to represent a declared function (either file-scope
  1109. -    or block-local) which has "external linkage" (according to ANSI-C).  */
  1110. - static void
  1111. - output_global_subroutine_die (arg)
  1112. -      register void *arg;
  1113. - {
  1114. -   register tree decl = arg;
  1115. -   register tree type = TREE_TYPE (decl);
  1116. -   register tree return_type = TREE_TYPE (type);
  1117. -   ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_global_subroutine);
  1118. -   sibling_attribute ();
  1119. -   dienum_push ();
  1120. -   name_and_src_coords_attributes (decl);
  1121. -   inline_attribute (decl);
  1122. -   prototyped_attribute (type);
  1123. -   member_attribute (DECL_CONTEXT (decl));
  1124. -   type_attribute (return_type, 0, 0);
  1125. -   if (!TREE_EXTERNAL (decl))
  1126. -     {
  1127. -       char func_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
  1128. -       low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
  1129. -       sprintf (func_end_label, FUNC_END_LABEL_FMT, current_funcdef_number);
  1130. -       high_pc_attribute (func_end_label);
  1131. -     }
  1132. - }
  1133.   /* Output a DIE to represent a declared data object (either file-scope
  1134.      or block-local) which has "external linkage" (according to ANSI-C).  */
  1135.   
  1136. --- 2705,2710 ----
  1137. ***************
  1138. *** 2868,2880 ****
  1139.     member_attribute (DECL_CONTEXT (decl));
  1140.     type_attribute (member_declared_type (decl),
  1141.             TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
  1142. !   if (DECL_BIT_FIELD_TYPE (decl))    /* If this is a bit field... */
  1143.       {
  1144. !       byte_size_attribute (decl);
  1145. !       bit_size_attribute (decl);
  1146. !       bit_offset_attribute (decl);
  1147.       }
  1148. -   data_member_location_attribute (decl);
  1149.   }
  1150.   
  1151.   #if 0
  1152. --- 2877,2905 ----
  1153.     member_attribute (DECL_CONTEXT (decl));
  1154.     type_attribute (member_declared_type (decl),
  1155.             TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
  1156. !   /* Handle C++ static data member declarations & definitions.  Any FIELD_DECL
  1157. !      node marked as EXTERNAL must represent the declaration of a C++ static
  1158. !      data member (usually within its containing classtype definition).  Any
  1159. !      FIELD_DECL node marked as STATIC represents a definition of a C++ static
  1160. !      data member (outside of its classtype definition).  */
  1161. !   if (!TREE_EXTERNAL (decl))
  1162.       {
  1163. !       if (TREE_STATIC (decl))
  1164. !         location_attribute (decl);  /* static data member definition */
  1165. !       else
  1166. !         {
  1167. !           /* Come here for non-static data members.  */
  1168. !           if (DECL_BIT_FIELD_TYPE (decl))  /* If this is a bit field... */
  1169. !             {
  1170. !               byte_size_attribute (decl);
  1171. !               bit_size_attribute (decl);
  1172. !               bit_offset_attribute (decl);
  1173. !             }
  1174. !           data_member_location_attribute (decl);
  1175. !         }
  1176.       }
  1177.   }
  1178.   
  1179.   #if 0
  1180. ***************
  1181. *** 3016,3026 ****
  1182.       }
  1183.   }
  1184.   
  1185. ! /* Output a DIE to represent a declared function (either file-scope
  1186. !    or block-local) which has "internal linkage" (according to ANSI-C).  */
  1187.   
  1188.   static void
  1189. ! output_local_subroutine_die (arg)
  1190.        register void *arg;
  1191.   {
  1192.     register tree decl = arg;
  1193. --- 3041,3050 ----
  1194.       }
  1195.   }
  1196.   
  1197. ! /* Output a DIE to represent a declared function.  */
  1198.   
  1199.   static void
  1200. ! output_subroutine_die (arg)
  1201.        register void *arg;
  1202.   {
  1203.     register tree decl = arg;
  1204. ***************
  1205. *** 3027,3034 ****
  1206.     register tree type = TREE_TYPE (decl);
  1207.     register tree return_type = TREE_TYPE (type);
  1208.     char func_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
  1209.   
  1210. -   ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_subroutine);
  1211.     sibling_attribute ();
  1212.     dienum_push ();
  1213.     name_and_src_coords_attributes (decl);
  1214. --- 3051,3069 ----
  1215.     register tree type = TREE_TYPE (decl);
  1216.     register tree return_type = TREE_TYPE (type);
  1217.     char func_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
  1218. +   register tree context = DECL_CONTEXT (decl);
  1219. +   /* Note that the g++ front-end currently screws up and unsets the
  1220. +      TREE_PUBLIC flag on FUNCTION_DECL nodes representing member
  1221. +      function definitions which appear after their containing class
  1222. +      types.  We conpensate for that screw-up here.  */
  1223. +   register int external_linkage
  1224. +     = TREE_PUBLIC (decl) || DECL_EXTERNAL (decl) || is_class_type (context);
  1225. +   ASM_OUTPUT_DWARF_TAG (asm_out_file,
  1226. +                         external_linkage
  1227. +                           ? TAG_global_subroutine
  1228. +                           : TAG_subroutine);
  1229.   
  1230.     sibling_attribute ();
  1231.     dienum_push ();
  1232.     name_and_src_coords_attributes (decl);
  1233. ***************
  1234. *** 3040,3046 ****
  1235.     /* Avoid getting screwed up in cases where a function was declared static
  1236.        but where no definition was ever given for it.  */
  1237.   
  1238. !   if (TREE_ASM_WRITTEN (decl))
  1239.       {
  1240.         low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
  1241.         sprintf (func_end_label, FUNC_END_LABEL_FMT, current_funcdef_number);
  1242. --- 3075,3081 ----
  1243.     /* Avoid getting screwed up in cases where a function was declared static
  1244.        but where no definition was ever given for it.  */
  1245.   
  1246. !   if (TREE_ASM_WRITTEN (decl) && !TREE_EXTERNAL (decl))
  1247.       {
  1248.         low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
  1249.         sprintf (func_end_label, FUNC_END_LABEL_FMT, current_funcdef_number);
  1250. ***************
  1251. *** 3730,3735 ****
  1252. --- 3765,3772 ----
  1253.        register tree decl;
  1254.        register tree containing_scope;
  1255.   {
  1256. +   register int doing_member_of_current_class;
  1257.     if (TREE_CODE (decl) == ERROR_MARK)
  1258.       return;
  1259.   
  1260. ***************
  1261. *** 3737,3747 ****
  1262.        But don't ignore a function definition, since that would screw
  1263.        up our count of blocks, and that it turn will completely screw up the
  1264.        the labels we will reference in subsequent AT_low_pc and AT_high_pc
  1265. !      attributes (for subsequent blocks).  */
  1266. !   if (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL)
  1267.       return;
  1268.   
  1269.     switch (TREE_CODE (decl))
  1270.       {
  1271.       case CONST_DECL:
  1272. --- 3774,3800 ----
  1273.        But don't ignore a function definition, since that would screw
  1274.        up our count of blocks, and that it turn will completely screw up the
  1275.        the labels we will reference in subsequent AT_low_pc and AT_high_pc
  1276. !      attributes (for subsequent blocks).  Also, don't ignore TYPE_DECLs
  1277. !      which are marked as "ignorable".  Those come from the g++ front end
  1278. !      and we really must not totally ignore them.  */
  1279. !   if (DECL_IGNORED_P (decl)
  1280. !       && TREE_CODE (decl) != FUNCTION_DECL
  1281. !       && TREE_CODE (decl) != TYPE_DECL)
  1282.       return;
  1283.   
  1284. +   /* Set a flag variable to say if the decl we are dealing with at the
  1285. +      moment happens to be a member of the classtype we are currently
  1286. +      generating DIEs for.  (We have to do some special stuff when we
  1287. +      are generating DWARF to represent the declarations of member
  1288. +      functions of the current classtype and/or when we are generating
  1289. +      DWARF to represent the declarations of static member variables of
  1290. +      the current classtype.  */
  1291. +   doing_member_of_current_class
  1292. +     = is_class_type (containing_scope)
  1293. +       && containing_scope == DECL_ACTUAL_CONTEXT (decl);
  1294.     switch (TREE_CODE (decl))
  1295.       {
  1296.       case CONST_DECL:
  1297. ***************
  1298. *** 3750,3766 ****
  1299.         break;
  1300.   
  1301.       case FUNCTION_DECL:
  1302. !       /* If we are in terse mode, don't output any DIEs to represent
  1303. !      mere external function declarations.  Also, if we are conforming
  1304. !      to the DWARF version 1 specification, don't output DIEs for
  1305. !      mere external function declarations.  */
  1306. !       if (TREE_EXTERNAL (decl))
  1307. ! #if (DWARF_VERSION > 1)
  1308. !     if (debug_info_level <= DINFO_LEVEL_TERSE)
  1309. ! #endif
  1310. !       break;
  1311.   
  1312.         /* Before we describe the FUNCTION_DECL itself, make sure that we
  1313.        have described its return type.  */
  1314.   
  1315. --- 3803,3820 ----
  1316.         break;
  1317.   
  1318.       case FUNCTION_DECL:
  1319. !       /* If we are in terse mode or if we are conforming to the DWARF
  1320. !      version 1 specification, don't output DIEs for mere external
  1321. !      function declarations, unless of course the declarations in
  1322. !      question are for C++ member functions and we are currently
  1323. !      generating DIEs for the members of some classtype.  */
  1324.   
  1325. +       if (TREE_EXTERNAL (decl) && !doing_member_of_current_class)
  1326. +     {
  1327. +       if (debug_info_level <= DINFO_LEVEL_TERSE)
  1328. +         break;
  1329. +     }
  1330.         /* Before we describe the FUNCTION_DECL itself, make sure that we
  1331.        have described its return type.  */
  1332.   
  1333. ***************
  1334. *** 3767,3778 ****
  1335.         output_type (TREE_TYPE (TREE_TYPE (decl)), containing_scope);
  1336.   
  1337.         /* If the following DIE will represent a function definition for a
  1338. !      function with "extern" linkage, output a special "pubnames" DIE
  1339. !      label just ahead of the actual DIE.  A reference to this label
  1340. !      was already generated in the .debug_pubnames section sub-entry
  1341. !      for this function definition.  */
  1342.   
  1343. !       if (TREE_PUBLIC (decl))
  1344.       {
  1345.         char label[MAX_ARTIFICIAL_LABEL_BYTES];
  1346.   
  1347. --- 3821,3833 ----
  1348.         output_type (TREE_TYPE (TREE_TYPE (decl)), containing_scope);
  1349.   
  1350.         /* If the following DIE will represent a function definition for a
  1351. !      file-scope function definition which has "external linkage" (as
  1352. !      that term is defined by the ANSI C standard) output a special
  1353. !      "pubnames" DIE label just ahead of the actual DIE.  A reference
  1354. !      to this label was already generated in the .debug_pubnames
  1355. !      section sub-entry for this function definition.  */
  1356.   
  1357. !       if (containing_scope == NULL_TREE && TREE_PUBLIC (decl))
  1358.       {
  1359.         char label[MAX_ARTIFICIAL_LABEL_BYTES];
  1360.   
  1361. ***************
  1362. *** 3780,3791 ****
  1363.         ASM_OUTPUT_LABEL (asm_out_file, label);
  1364.       }
  1365.   
  1366. !       /* Now output a DIE to represent the function itself.  */
  1367.   
  1368. !       output_die (TREE_PUBLIC (decl) || TREE_EXTERNAL (decl)
  1369. !                 ? output_global_subroutine_die
  1370. !                 : output_local_subroutine_die,
  1371. !           decl);
  1372.   
  1373.         /* Now output descriptions of the arguments for this function.
  1374.        This gets (unnecessarily?) complex because of the fact that
  1375. --- 3835,3862 ----
  1376.         ASM_OUTPUT_LABEL (asm_out_file, label);
  1377.       }
  1378.   
  1379. !       /* Now output a DIE to represent the function itself.  Note that C++
  1380. !      member functions *always* have external linkage, regardless of
  1381. !      whether or not the g++ front end screws up the TREE_PUBLIC flag.  */
  1382.   
  1383. !       if (!doing_member_of_current_class)
  1384. !         output_die (output_subroutine_die, decl);
  1385. !       else
  1386. !         {
  1387. !           register int saved_external_flag = DECL_EXTERNAL (decl);
  1388. !           /* In the case where we are going to generate a DIE for a member
  1389. !              function within the list of children of it's parent classtype,
  1390. !              we need to fool the `output_subroutine_die' routine into
  1391. !              avoiding the generation of AT_low_pc and AT_high_pc attributes
  1392. !              within the DIE.  We do that by temporarily marking the DECL
  1393. !              node as "external" and then setting it back to the way it
  1394. !              was before.  */
  1395. !           TREE_EXTERNAL (decl) = 1;  /* Fool `output_subroutine_die'.  */
  1396. !           output_die (output_subroutine_die, decl);
  1397. !           TREE_EXTERNAL (decl) = saved_external_flag;
  1398. !     }
  1399.   
  1400.         /* Now output descriptions of the arguments for this function.
  1401.        This gets (unnecessarily?) complex because of the fact that
  1402. ***************
  1403. *** 3796,3808 ****
  1404.        with the FUNCTION_DECL.  This will be a node of type FUNCTION_TYPE.
  1405.        If the chain of type nodes hanging off of this FUNCTION_TYPE node
  1406.        ends with a void_type_node then there should *not* be an ellipsis
  1407. !      at the end.  */
  1408.   
  1409. !       /* In the case where we are describing an external function, all
  1410.        we need to do here (and all we *can* do here) is to describe
  1411. !      the *types* of its formal parameters.  */
  1412.   
  1413. !       if (TREE_EXTERNAL (decl))
  1414.       output_formal_types (TREE_TYPE (decl));
  1415.         else
  1416.       {
  1417. --- 3867,3894 ----
  1418.        with the FUNCTION_DECL.  This will be a node of type FUNCTION_TYPE.
  1419.        If the chain of type nodes hanging off of this FUNCTION_TYPE node
  1420.        ends with a void_type_node then there should *not* be an ellipsis
  1421. !      at the end.
  1422.   
  1423. !          In the case where we are describing an external function, all
  1424.        we need to do here (and all we *can* do here) is to describe
  1425. !      the *types* of its formal parameters.
  1426. !      Also, in the case where we are generating info for a member function
  1427. !      of some C++ classtype, and where we currently generating DIEs for
  1428. !      entities declared within the containing classtype itself, we should
  1429. !      not try to generate TAG_formal_parameter DIEs which contain either
  1430. !      AT_name or AT_location attributes, because in these cases, we want
  1431. !      to just act like the given member function was *declared* but not
  1432. !      *defined* within the classtype definition.  The actual definition of
  1433. !      the given member function should always appear to exist separately,
  1434. !      in the same scope where the containing classtype definition appears,
  1435. !      and following the classtype definition.  (Note that these "following"
  1436. !      definitions of member functions may be created artifically by the
  1437. !      compiler in some cases.  See the "rewrite rule" in section 9.3.2/1
  1438. !      of the ARM.)
  1439. !       */
  1440.   
  1441. !       if (TREE_EXTERNAL (decl) || doing_member_of_current_class)
  1442.       output_formal_types (TREE_TYPE (decl));
  1443.         else
  1444.       {
  1445. ***************
  1446. *** 3818,3824 ****
  1447.            being explicitly told.  */
  1448.   
  1449.         if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
  1450. !         arg_decls = TREE_CHAIN (arg_decls);
  1451.   
  1452.         {
  1453.           register tree last_arg;
  1454. --- 3904,3910 ----
  1455.            being explicitly told.  */
  1456.   
  1457.         if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
  1458. !         arg_decls = arg_decls ? TREE_CHAIN (arg_decls) : NULL_TREE;
  1459.   
  1460.         {
  1461.           register tree last_arg;
  1462. ***************
  1463. *** 3934,3945 ****
  1464.       }
  1465.   
  1466.         /* Output Dwarf info for all of the stuff within the body of the
  1467. !      function (if it has one - it may be just a declaration).  */
  1468.   
  1469.         {
  1470.       register tree outer_scope = DECL_INITIAL (decl);
  1471.   
  1472. !     if (outer_scope && TREE_CODE (outer_scope) != ERROR_MARK)
  1473.         {
  1474.           /* Note that here, `outer_scope' is a pointer to the outermost
  1475.              BLOCK node created to represent the body of a function.
  1476. --- 4020,4045 ----
  1477.       }
  1478.   
  1479.         /* Output Dwarf info for all of the stuff within the body of the
  1480. !      function (if it has one - it may be just a declaration).  In
  1481. !      the case where we are generating info for a member function of
  1482. !      some C++ classtype, and where we currently generating DIEs for
  1483. !      entities declared within the containing classtype itself, we
  1484. !      must not generate any info for the body of the member function
  1485. !      because that info will be generated when we are generating the
  1486. !      DIEs for the function's *definition*, and that definition should
  1487. !      always appear to exist separately, in the same scope where the
  1488. !      containing classtype definition appears, and following the class-
  1489. !      type definition.  (Note that these "following" definitions of
  1490. !      member functions may be created artifically by the compiler in
  1491. !      some cases.  See the "rewrite rule" in section 9.3.2/1 of the ARM.)
  1492. !       */
  1493.   
  1494.         {
  1495.       register tree outer_scope = DECL_INITIAL (decl);
  1496.   
  1497. !     if (outer_scope
  1498. !         && TREE_CODE (outer_scope) != ERROR_MARK
  1499. !         && !doing_member_of_current_class)
  1500.         {
  1501.           /* Note that here, `outer_scope' is a pointer to the outermost
  1502.              BLOCK node created to represent the body of a function.
  1503. ***************
  1504. *** 4000,4012 ****
  1505.         /* Note that unlike the gcc front end (which generates a NULL named
  1506.        TYPE_DECL node for each complete tagged type, each array type,
  1507.        and each function type node created) the g++ front end generates
  1508. !      a *named* TYPE_DECL node for each tagged type node created.
  1509. !      Unfortunately, these g++ TYPE_DECL nodes cause us to output many
  1510. !      superfluous and unnecessary TAG_typedef DIEs here.  When g++ is
  1511. !      fixed to stop generating these superfluous named TYPE_DECL nodes,
  1512. !      the superfluous TAG_typedef DIEs will likewise cease.  */
  1513. !       if (DECL_NAME (decl))
  1514.       /* Output a DIE to represent the typedef itself.  */
  1515.       output_die (output_typedef_die, decl);
  1516.         break;
  1517. --- 4100,4114 ----
  1518.         /* Note that unlike the gcc front end (which generates a NULL named
  1519.        TYPE_DECL node for each complete tagged type, each array type,
  1520.        and each function type node created) the g++ front end generates
  1521. !      a *named* TYPE_DECL node for each tagged type node created.  We
  1522. !      must filter out these g++ TYPE_DECL nodes or else they will cause
  1523. !      us to output many superfluous and unnecessary TAG_typedef DIEs.
  1524. !      We filter out these evil g++ TYPE_DECL nodes here.  */
  1525. !       if (DECL_NAME (decl)
  1526. !       && (strcmp (language_string, "GNU C++") != 0
  1527. !           || (IDENTIFIER_POINTER (DECL_NAME (decl))[0] != ' '
  1528. !           && TYPE_NAME (TREE_TYPE (decl)) != decl)))
  1529.       /* Output a DIE to represent the typedef itself.  */
  1530.       output_die (output_typedef_die, decl);
  1531.         break;
  1532. ***************
  1533. *** 4017,4022 ****
  1534. --- 4119,4152 ----
  1535.         break;
  1536.   
  1537.       case VAR_DECL:
  1538. +       /* The g++ front end represents static data members of classtypes as
  1539. +          VAR_DECL nodes rather than as FIELD_DECL nodes.  Don't ask me why.
  1540. +          Anyway, we handle them here.  */
  1541. +       if (is_class_type (DECL_CONTEXT (decl)))
  1542. +         {
  1543. +           output_type (TREE_TYPE (decl), containing_scope);
  1544. +           if (!doing_member_of_current_class)
  1545. +             output_die (output_member_die, decl);
  1546. +           else
  1547. +             {
  1548. +               register int saved_external_flag = DECL_EXTERNAL (decl);
  1549. +               /* In the case where we are going to generate a DIE for a C++
  1550. +                  static data member within the list of children of it's
  1551. +                  parent classtype, we need to fool the `output_member_die'
  1552. +                  routine into avoiding the generation of the AT_location
  1553. +                  attributes within the DIE.  We do that by temporarily
  1554. +                  marking the DECL node as "external" and then setting it
  1555. +                  back to the way it was before.  */
  1556. +               DECL_EXTERNAL (decl) = 1;  /* Fool `output_member_die'.  */
  1557. +               output_die (output_member_die, decl);
  1558. +               DECL_EXTERNAL (decl) = saved_external_flag;
  1559. +             }
  1560. +           break;
  1561. +         }
  1562.         /* If we are conforming to the DWARF version 1 specification, don't
  1563.        generated any DIEs to represent mere external object declarations.  */
  1564.   
  1565. ***************
  1566. *** 4095,4108 ****
  1567.        up our count of blocks, and that it turn will completely screw up the
  1568.        the labels we will reference in subsequent AT_low_pc and AT_high_pc
  1569.        attributes (for subsequent blocks).  (It's too bad that BLOCK nodes
  1570. !      don't carry their own sequence numbers with them!)  */
  1571. !   if (DECL_IGNORED_P (decl))
  1572. !     {
  1573. !       if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL)
  1574. !     abort ();
  1575. !       return;
  1576. !     }
  1577.   
  1578.     switch (TREE_CODE (decl))
  1579.       {
  1580. --- 4225,4238 ----
  1581.        up our count of blocks, and that it turn will completely screw up the
  1582.        the labels we will reference in subsequent AT_low_pc and AT_high_pc
  1583.        attributes (for subsequent blocks).  (It's too bad that BLOCK nodes
  1584. !      don't carry their own sequence numbers with them!) Also, don't ignore
  1585. !      TYPE_DECL's which are marked as "ignorable".  Those come from the g++
  1586. !      front end and we really must not totally ignore them.  */
  1587. !   if (DECL_IGNORED_P (decl)
  1588. !       && TREE_CODE (decl) != FUNCTION_DECL
  1589. !       && TREE_CODE (decl) != TYPE_DECL)
  1590. !     return;
  1591.   
  1592.     switch (TREE_CODE (decl))
  1593.       {
  1594. ***************
  1595. *** 4590,4595 ****
  1596. --- 4720,4729 ----
  1597.        register FILE *asm_out_file;
  1598.        register char *main_input_filename;
  1599.   {
  1600. +   /* Adapt to bugs elsewhere.  */
  1601. +   gplusplus_trees = (strcmp (language_string, "GNU C++") == 0);
  1602.     /* Remember the name of the primary input file.  */
  1603.   
  1604.     primary_filename = main_input_filename;
  1605. *** 1.7    1992/06/11 23:40:40
  1606. --- emit-rtl.c    1992/10/09 20:09:29
  1607. ***************
  1608. *** 2171,2176 ****
  1609. --- 2171,2207 ----
  1610.     return last;
  1611.   }
  1612.   
  1613. + /* Emit the insns in a chain starting with FIRST and place them in back of
  1614. +    the insn AFTER.  Return the last insn emitted.  */
  1615. + rtx
  1616. + emit_insns_after (first, after)
  1617. +      register rtx first;
  1618. +      register rtx after;
  1619. + {
  1620. +   register rtx last;
  1621. +   register rtx after_after;
  1622. +   if (!after)
  1623. +     abort ();
  1624. +   if (!first)
  1625. +     return first;
  1626. +   for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
  1627. +     continue;
  1628. +   after_after = NEXT_INSN (after);
  1629. +   NEXT_INSN (after) = first;
  1630. +   PREV_INSN (first) = after;
  1631. +   NEXT_INSN (last) = after_after;
  1632. +   if (after_after)
  1633. +     PREV_INSN (after_after) = last;
  1634. +   return last;
  1635. + }
  1636.   /* Make an insn of code JUMP_INSN with pattern PATTERN
  1637.      and add it to the end of the doubly-linked list.  */
  1638.   
  1639. *** 1.3    1992/06/11 23:40:40
  1640. --- expr.c    1992/10/09 20:09:32
  1641. ***************
  1642. *** 1696,1701 ****
  1643. --- 1696,1707 ----
  1644.   
  1645.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  1646.   
  1647. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  1648. + #ifdef ENCODE_SECTION_INFO
  1649. +   /* mark it as a function (to be in the text section that is) */
  1650. +   SYMBOL_REF_FLAG (fun) = 1;
  1651. + #endif
  1652.     INIT_CUMULATIVE_ARGS (args_so_far, (tree)0, fun);
  1653.   
  1654.     args_size.constant = 0;
  1655. *** 1.4    1992/08/14 15:10:24
  1656. --- fold-const.c    1992/10/09 20:09:38
  1657. ***************
  1658. *** 48,58 ****
  1659.   /* Handle floating overflow for `const_binop'.  */
  1660.   static jmp_buf float_error;
  1661.   
  1662. ! void lshift_double ();
  1663.   void rshift_double ();
  1664.   void lrotate_double ();
  1665.   void rrotate_double ();
  1666.   static tree const_binop ();
  1667.   
  1668.   /* To do constant folding on INTEGER_CST nodes requires 64-bit arithmetic.
  1669.      We do that by representing the 64-bit integer as 8 shorts,
  1670. --- 48,66 ----
  1671.   /* Handle floating overflow for `const_binop'.  */
  1672.   static jmp_buf float_error;
  1673.   
  1674. ! int lshift_double ();
  1675.   void rshift_double ();
  1676.   void lrotate_double ();
  1677.   void rrotate_double ();
  1678.   static tree const_binop ();
  1679. + /* Yield nonzero if a signed left shift of A by B bits overflows.
  1680. +    A is a C int; B is nonnegative.  */
  1681. + #define left_shift_overflows(a, b)  ((a)  ^  ((a) << (b)) >> (b))
  1682. + /* Yield nonzero if adding two numbers with A's and B's signs can yield a
  1683. +    number with SUM's sign, where A, B, and SUM are all C ints.  */
  1684. + #define possible_sum_sign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0)
  1685.   
  1686.   /* To do constant folding on INTEGER_CST nodes requires 64-bit arithmetic.
  1687.      We do that by representing the 64-bit integer as 8 shorts,
  1688. ***************
  1689. *** 96,107 ****
  1690.   
  1691.   /* Make the integer constant T valid for its type
  1692.      by setting to 0 or 1 all the bits in the constant
  1693. !    that don't belong in the type.  */
  1694.   
  1695.   static void
  1696. ! force_fit_type (t)
  1697.        tree t;
  1698.   {
  1699.     register int prec = TYPE_PRECISION (TREE_TYPE (t));
  1700.   
  1701.     if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
  1702. --- 104,120 ----
  1703.   
  1704.   /* Make the integer constant T valid for its type
  1705.      by setting to 0 or 1 all the bits in the constant
  1706. !    that don't belong in the type.
  1707. !    Mark the constant if it has overflowed.
  1708. !    If OVERFLOW is nonzero and the result is signed,
  1709. !    the calculation has already overflowed.  */
  1710.   
  1711.   static void
  1712. ! force_fit_type (t, overflow)
  1713.        tree t;
  1714. +      int overflow;
  1715.   {
  1716. +   int low = TREE_INT_CST_LOW (t), high = TREE_INT_CST_HIGH (t);
  1717.     register int prec = TYPE_PRECISION (TREE_TYPE (t));
  1718.   
  1719.     if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
  1720. ***************
  1721. *** 147,161 ****
  1722.             |= ((-1) << prec);
  1723.       }
  1724.       }
  1725.   }
  1726.   
  1727.   /* Add two 64-bit integers with 64-bit result.
  1728.      Each argument is given as two `int' pieces.
  1729.      One argument is L1 and H1; the other, L2 and H2.
  1730.      The value is stored as two `int' pieces in *LV and *HV.
  1731.      We use the 8-shorts representation internally.  */
  1732.   
  1733. ! void
  1734.   add_double (l1, h1, l2, h2, lv, hv)
  1735.        int l1, h1, l2, h2;
  1736.        int *lv, *hv;
  1737. --- 160,181 ----
  1738.             |= ((-1) << prec);
  1739.       }
  1740.       }
  1741. +   /* In C, by definition, unsigned arithmetic does not overflow.
  1742. +      But sometimes we want to warn about unsigned truncation.  */
  1743. +   if ((low ^ TREE_INT_CST_LOW (t)) | (high ^ TREE_INT_CST_HIGH (t))
  1744. +       || overflow && ! TREE_UNSIGNED (TREE_TYPE (t)))
  1745. +     TREE_CONSTANT_OVERFLOW (t) = 1;
  1746.   }
  1747.   
  1748.   /* Add two 64-bit integers with 64-bit result.
  1749. +    Yield nonzero if the (signed) operation overflows.
  1750.      Each argument is given as two `int' pieces.
  1751.      One argument is L1 and H1; the other, L2 and H2.
  1752.      The value is stored as two `int' pieces in *LV and *HV.
  1753.      We use the 8-shorts representation internally.  */
  1754.   
  1755. ! int
  1756.   add_double (l1, h1, l2, h2, lv, hv)
  1757.        int l1, h1, l2, h2;
  1758.        int *lv, *hv;
  1759. ***************
  1760. *** 176,189 ****
  1761.       }
  1762.   
  1763.     decode (arg1, lv, hv);
  1764.   }
  1765.   
  1766.   /* Negate a 64-bit integers with 64-bit result.
  1767.      The argument is given as two `int' pieces in L1 and H1.
  1768.      The value is stored as two `int' pieces in *LV and *HV.
  1769.      We use the 8-shorts representation internally.  */
  1770.   
  1771. ! void
  1772.   neg_double (l1, h1, lv, hv)
  1773.        int l1, h1;
  1774.        int *lv, *hv;
  1775. --- 196,211 ----
  1776.       }
  1777.   
  1778.     decode (arg1, lv, hv);
  1779. +   return !possible_sum_sign (h1, h2, *hv);
  1780.   }
  1781.   
  1782.   /* Negate a 64-bit integers with 64-bit result.
  1783. +    Yield nonzero if the (signed) operation overflows.
  1784.      The argument is given as two `int' pieces in L1 and H1.
  1785.      The value is stored as two `int' pieces in *LV and *HV.
  1786.      We use the 8-shorts representation internally.  */
  1787.   
  1788. ! int
  1789.   neg_double (l1, h1, lv, hv)
  1790.        int l1, h1;
  1791.        int *lv, *hv;
  1792. ***************
  1793. *** 198,212 ****
  1794.         *lv = - l1;
  1795.         *hv = ~ h1;
  1796.       }
  1797.   }
  1798.   
  1799.   /* Multiply two 64-bit integers with 64-bit result.
  1800.      Each argument is given as two `int' pieces.
  1801.      One argument is L1 and H1; the other, L2 and H2.
  1802.      The value is stored as two `int' pieces in *LV and *HV.
  1803.      We use the 8-shorts representation internally.  */
  1804.   
  1805. ! void
  1806.   mul_double (l1, h1, l2, h2, lv, hv)
  1807.        int l1, h1, l2, h2;
  1808.        int *lv, *hv;
  1809. --- 220,236 ----
  1810.         *lv = - l1;
  1811.         *hv = ~ h1;
  1812.       }
  1813. +   return (h1 & *hv) < 0;
  1814.   }
  1815.   
  1816.   /* Multiply two 64-bit integers with 64-bit result.
  1817. +    Yield nonzero if the (signed) operation overflows.
  1818.      Each argument is given as two `int' pieces.
  1819.      One argument is L1 and H1; the other, L2 and H2.
  1820.      The value is stored as two `int' pieces in *LV and *HV.
  1821.      We use the 8-shorts representation internally.  */
  1822.   
  1823. ! int
  1824.   mul_double (l1, h1, l2, h2, lv, hv)
  1825.        int l1, h1, l2, h2;
  1826.        int *lv, *hv;
  1827. ***************
  1828. *** 216,248 ****
  1829.     short prod[16];
  1830.     register int carry = 0;
  1831.     register int i, j, k;
  1832.   
  1833. !   /* These two cases are used extensively, arising from pointer
  1834. !      combinations.  */
  1835.     if (h2 == 0)
  1836.       {
  1837.         if (l2 == 2)
  1838.       {
  1839.         unsigned temp = l1 + l1;
  1840. !       *hv = h1 * 2 + (temp < l1);
  1841.         *lv = temp;
  1842. !       return;
  1843.       }
  1844.         if (l2 == 4)
  1845.       {
  1846.         unsigned temp = l1 + l1;
  1847. !       h1 = h1 * 4 + ((temp < l1) << 1);
  1848.         l1 = temp;
  1849.         temp += temp;
  1850.         h1 += (temp < l1);
  1851.         *lv = temp;
  1852.         *hv = h1;
  1853. !       return;
  1854.       }
  1855.         if (l2 == 8)
  1856.       {
  1857.         unsigned temp = l1 + l1;
  1858. !       h1 = h1 * 8 + ((temp < l1) << 2);
  1859.         l1 = temp;
  1860.         temp += temp;
  1861.         h1 += (temp < l1) << 1;
  1862. --- 240,275 ----
  1863.     short prod[16];
  1864.     register int carry = 0;
  1865.     register int i, j, k;
  1866. +   int toplow, tophigh, neglow, neghigh;
  1867.   
  1868. !   /* These cases are used extensively, arising from pointer combinations.  */
  1869.     if (h2 == 0)
  1870.       {
  1871.         if (l2 == 2)
  1872.       {
  1873. +       int overflow = left_shift_overflows (h1, 1);
  1874.         unsigned temp = l1 + l1;
  1875. !       *hv = (h1 << 1) + (temp < l1);
  1876.         *lv = temp;
  1877. !       return overflow;
  1878.       }
  1879.         if (l2 == 4)
  1880.       {
  1881. +       int overflow = left_shift_overflows (h1, 2);
  1882.         unsigned temp = l1 + l1;
  1883. !       h1 = (h1 << 2) + ((temp < l1) << 1);
  1884.         l1 = temp;
  1885.         temp += temp;
  1886.         h1 += (temp < l1);
  1887.         *lv = temp;
  1888.         *hv = h1;
  1889. !       return overflow;
  1890.       }
  1891.         if (l2 == 8)
  1892.       {
  1893. +       int overflow = left_shift_overflows (h1, 3);
  1894.         unsigned temp = l1 + l1;
  1895. !       h1 = (h1 << 3) + ((temp < l1) << 2);
  1896.         l1 = temp;
  1897.         temp += temp;
  1898.         h1 += (temp < l1) << 1;
  1899. ***************
  1900. *** 251,257 ****
  1901.         h1 += (temp < l1);
  1902.         *lv = temp;
  1903.         *hv = h1;
  1904. !       return;
  1905.       }
  1906.       }
  1907.   
  1908. --- 278,284 ----
  1909.         h1 += (temp < l1);
  1910.         *lv = temp;
  1911.         *hv = h1;
  1912. !       return overflow;
  1913.       }
  1914.       }
  1915.   
  1916. ***************
  1917. *** 275,280 ****
  1918. --- 302,322 ----
  1919.         }
  1920.   
  1921.     decode (prod, lv, hv);    /* @@decode ignores prod[8] -> prod[15] */
  1922. +   /* Check for overflow by calculating the top half of the answer in full;
  1923. +      it should agree with the low half's sign bit.  */
  1924. +   decode (prod+8, &toplow, &tophigh);
  1925. +   if (h1 < 0)
  1926. +     {
  1927. +       neg_double (l2, h2, &neglow, &neghigh);
  1928. +       add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
  1929. +     }
  1930. +   if (h2 < 0)
  1931. +     {
  1932. +       neg_double (l1, h1, &neglow, &neghigh);
  1933. +       add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
  1934. +     }
  1935. +   return *hv < 0 ? ~(toplow & tophigh) : (toplow | tophigh);
  1936.   }
  1937.   
  1938.   /* Shift the 64-bit integer in L1, H1 left by COUNT places
  1939. ***************
  1940. *** 281,289 ****
  1941.      keeping only PREC bits of result.
  1942.      Shift right if COUNT is negative.
  1943.      ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
  1944.      Store the value as two `int' pieces in *LV and *HV.  */
  1945.   
  1946. ! void
  1947.   lshift_double (l1, h1, count, prec, lv, hv, arith)
  1948.        int l1, h1, count, prec;
  1949.        int *lv, *hv;
  1950. --- 323,332 ----
  1951.      keeping only PREC bits of result.
  1952.      Shift right if COUNT is negative.
  1953.      ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
  1954. +    Yield nonzero if the arithmetic shift overflows.
  1955.      Store the value as two `int' pieces in *LV and *HV.  */
  1956.   
  1957. ! int
  1958.   lshift_double (l1, h1, count, prec, lv, hv, arith)
  1959.        int l1, h1, count, prec;
  1960.        int *lv, *hv;
  1961. ***************
  1962. *** 291,302 ****
  1963.   {
  1964.     short arg1[8];
  1965.     register int i;
  1966. !   register int carry;
  1967.   
  1968.     if (count < 0)
  1969.       {
  1970.         rshift_double (l1, h1, - count, prec, lv, hv, arith);
  1971. !       return;
  1972.       }
  1973.   
  1974.     encode (arg1, l1, h1);
  1975. --- 334,345 ----
  1976.   {
  1977.     short arg1[8];
  1978.     register int i;
  1979. !   register int carry, overflow;
  1980.   
  1981.     if (count < 0)
  1982.       {
  1983.         rshift_double (l1, h1, - count, prec, lv, hv, arith);
  1984. !       return 0;
  1985.       }
  1986.   
  1987.     encode (arg1, l1, h1);
  1988. ***************
  1989. *** 304,309 ****
  1990. --- 347,353 ----
  1991.     if (count > prec)
  1992.       count = prec;
  1993.   
  1994. +   overflow = 0;
  1995.     while (count > 0)
  1996.       {
  1997.         carry = 0;
  1998. ***************
  1999. *** 314,326 ****
  2000.         carry >>= 8;
  2001.       }
  2002.         count--;
  2003.       }
  2004.   
  2005.     decode (arg1, lv, hv);
  2006.   }
  2007.   
  2008.   /* Shift the 64-bit integer in L1, H1 right by COUNT places
  2009. !    keeping only PREC bits of result.  COUNT must be positive.
  2010.      ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
  2011.      Store the value as two `int' pieces in *LV and *HV.  */
  2012.   
  2013. --- 358,372 ----
  2014.         carry >>= 8;
  2015.       }
  2016.         count--;
  2017. +       overflow |= carry ^ (arg1[7] >> 7);
  2018.       }
  2019.   
  2020.     decode (arg1, lv, hv);
  2021. +   return overflow;
  2022.   }
  2023.   
  2024.   /* Shift the 64-bit integer in L1, H1 right by COUNT places
  2025. !    keeping only PREC bits of result.  COUNT must be nonnegative.
  2026.      ARITH nonzero specifies arithmetic shifting; otherwise use logical shift.
  2027.      Store the value as two `int' pieces in *LV and *HV.  */
  2028.   
  2029. ***************
  2030. *** 433,441 ****
  2031.      TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR
  2032.      or EXACT_DIV_EXPR
  2033.      It controls how the quotient is rounded to a integer.
  2034.      UNS nonzero says do unsigned division.  */
  2035.   
  2036. ! static void
  2037.   div_and_round_double (code, uns,
  2038.                 lnum_orig, hnum_orig, lden_orig, hden_orig,
  2039.                 lquo, hquo, lrem, hrem)
  2040. --- 479,488 ----
  2041.      TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR
  2042.      or EXACT_DIV_EXPR
  2043.      It controls how the quotient is rounded to a integer.
  2044. +    Yield nonzero if the operation overflows.
  2045.      UNS nonzero says do unsigned division.  */
  2046.   
  2047. ! static int
  2048.   div_and_round_double (code, uns,
  2049.                 lnum_orig, hnum_orig, lden_orig, hden_orig,
  2050.                 lquo, hquo, lrem, hrem)
  2051. ***************
  2052. *** 453,458 ****
  2053. --- 500,506 ----
  2054.     int hnum = hnum_orig;
  2055.     unsigned int lden = lden_orig;
  2056.     int hden = hden_orig;
  2057. +   int overflow = 0;
  2058.   
  2059.     if ((hden == 0) && (lden == 0))
  2060.       abort ();
  2061. ***************
  2062. *** 460,474 ****
  2063.     /* calculate quotient sign and convert operands to unsigned.  */
  2064.     if (!uns) 
  2065.       {
  2066. !       if (hden < 0) 
  2067.       {
  2068.         quo_neg = ~ quo_neg;
  2069. !       neg_double (lden, hden, &lden, &hden);
  2070.       }
  2071. !       if (hnum < 0)
  2072.       {
  2073.         quo_neg = ~ quo_neg;
  2074. !       neg_double (lnum, hnum, &lnum, &hnum);
  2075.       }
  2076.       }
  2077.   
  2078. --- 508,524 ----
  2079.     /* calculate quotient sign and convert operands to unsigned.  */
  2080.     if (!uns) 
  2081.       {
  2082. !       if (hnum < 0)
  2083.       {
  2084.         quo_neg = ~ quo_neg;
  2085. !       /* (minimum integer) / (-1) is the only overflow case.  */
  2086. !       if (neg_double (lnum, hnum, &lnum, &hnum))
  2087. !         overflow = ~(hden & lden);
  2088.       }
  2089. !       if (hden < 0) 
  2090.       {
  2091.         quo_neg = ~ quo_neg;
  2092. !       neg_double (lden, hden, &lden, &hden);
  2093.       }
  2094.       }
  2095.   
  2096. ***************
  2097. *** 641,647 ****
  2098.       case TRUNC_DIV_EXPR:
  2099.       case TRUNC_MOD_EXPR:    /* round toward zero */
  2100.       case EXACT_DIV_EXPR:    /* for this one, it shouldn't matter */
  2101. !       return;
  2102.   
  2103.       case FLOOR_DIV_EXPR:
  2104.       case FLOOR_MOD_EXPR:    /* round toward negative infinity */
  2105. --- 691,697 ----
  2106.       case TRUNC_DIV_EXPR:
  2107.       case TRUNC_MOD_EXPR:    /* round toward zero */
  2108.       case EXACT_DIV_EXPR:    /* for this one, it shouldn't matter */
  2109. !       return overflow;
  2110.   
  2111.       case FLOOR_DIV_EXPR:
  2112.       case FLOOR_MOD_EXPR:    /* round toward negative infinity */
  2113. ***************
  2114. *** 650,656 ****
  2115.         /* quo = quo - 1;  */
  2116.         add_double (*lquo, *hquo, -1, -1, lquo, hquo);
  2117.       }
  2118. !       else return;
  2119.         break;
  2120.   
  2121.       case CEIL_DIV_EXPR:
  2122. --- 700,706 ----
  2123.         /* quo = quo - 1;  */
  2124.         add_double (*lquo, *hquo, -1, -1, lquo, hquo);
  2125.       }
  2126. !       else return overflow;
  2127.         break;
  2128.   
  2129.       case CEIL_DIV_EXPR:
  2130. ***************
  2131. *** 659,665 ****
  2132.       {
  2133.         add_double (*lquo, *hquo, 1, 0, lquo, hquo);
  2134.       }
  2135. !       else return;
  2136.         break;
  2137.       
  2138.       case ROUND_DIV_EXPR:
  2139. --- 709,715 ----
  2140.       {
  2141.         add_double (*lquo, *hquo, 1, 0, lquo, hquo);
  2142.       }
  2143. !       else return overflow;
  2144.         break;
  2145.       
  2146.       case ROUND_DIV_EXPR:
  2147. ***************
  2148. *** 685,691 ****
  2149.             /* quo = quo + 1; */
  2150.             add_double (*lquo, *hquo, 1, 0, lquo, hquo);
  2151.         }
  2152. !     else return;
  2153.         }
  2154.         break;
  2155.   
  2156. --- 735,741 ----
  2157.             /* quo = quo + 1; */
  2158.             add_double (*lquo, *hquo, 1, 0, lquo, hquo);
  2159.         }
  2160. !     else return overflow;
  2161.         }
  2162.         break;
  2163.   
  2164. ***************
  2165. *** 697,702 ****
  2166. --- 747,753 ----
  2167.     mul_double (*lquo, *hquo, lden_orig, hden_orig, lrem, hrem);
  2168.     neg_double (*lrem, *hrem, lrem, hrem);
  2169.     add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem);
  2170. +   return overflow;
  2171.   }
  2172.   
  2173.   #if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
  2174. ***************
  2175. *** 956,961 ****
  2176. --- 1007,1013 ----
  2177.         int garbagel, garbageh;
  2178.         register tree t;
  2179.         int uns = TREE_UNSIGNED (TREE_TYPE (arg1));
  2180. +       int overflow = 0;
  2181.   
  2182.         switch (code)
  2183.       {
  2184. ***************
  2185. *** 978,987 ****
  2186.       case RSHIFT_EXPR:
  2187.         int2l = - int2l;
  2188.       case LSHIFT_EXPR:
  2189. !       lshift_double (int1l, int1h, int2l,
  2190. !              TYPE_PRECISION (TREE_TYPE (arg1)),
  2191. !              &low, &hi,
  2192. !              !uns);
  2193.         t = build_int_2 (low, hi);
  2194.         break;
  2195.   
  2196. --- 1030,1039 ----
  2197.       case RSHIFT_EXPR:
  2198.         int2l = - int2l;
  2199.       case LSHIFT_EXPR:
  2200. !       overflow = lshift_double (int1l, int1h, int2l,
  2201. !                     TYPE_PRECISION (TREE_TYPE (arg1)),
  2202. !                     &low, &hi,
  2203. !                     !uns);
  2204.         t = build_int_2 (low, hi);
  2205.         break;
  2206.   
  2207. ***************
  2208. *** 999,1005 ****
  2209.           {
  2210.             int2l += int1l;
  2211.             if ((unsigned) int2l < int1l)
  2212. !         int2h += 1;
  2213.             t = build_int_2 (int2l, int2h);
  2214.             break;
  2215.           }
  2216. --- 1051,1057 ----
  2217.           {
  2218.             int2l += int1l;
  2219.             if ((unsigned) int2l < int1l)
  2220. !         overflow = int2h++ >= 0 && int2h < 0;
  2221.             t = build_int_2 (int2l, int2h);
  2222.             break;
  2223.           }
  2224. ***************
  2225. *** 1007,1017 ****
  2226.           {
  2227.             int1l += int2l;
  2228.             if ((unsigned) int1l < int2l)
  2229. !         int1h += 1;
  2230.             t = build_int_2 (int1l, int1h);
  2231.             break;
  2232.           }
  2233. !       add_double (int1l, int1h, int2l, int2h, &low, &hi);
  2234.         t = build_int_2 (low, hi);
  2235.         break;
  2236.   
  2237. --- 1059,1069 ----
  2238.           {
  2239.             int1l += int2l;
  2240.             if ((unsigned) int1l < int2l)
  2241. !         overflow = int1h++ >= 0 && int1h < 0;
  2242.             t = build_int_2 (int1l, int1h);
  2243.             break;
  2244.           }
  2245. !       overflow = add_double (int1l, int1h, int2l, int2h, &low, &hi);
  2246.         t = build_int_2 (low, hi);
  2247.         break;
  2248.   
  2249. ***************
  2250. *** 1021,1028 ****
  2251.             t = build_int_2 (int1l, int1h);
  2252.             break;
  2253.           }
  2254. !       neg_double (int2l, int2h, &int2l, &int2h);
  2255. !       add_double (int1l, int1h, int2l, int2h, &low, &hi);
  2256.         t = build_int_2 (low, hi);
  2257.         break;
  2258.   
  2259. --- 1073,1081 ----
  2260.             t = build_int_2 (int1l, int1h);
  2261.             break;
  2262.           }
  2263. !       neg_double (int2l, int2h, &low, &hi);
  2264. !       add_double (int1l, int1h, low, hi, &low, &hi);
  2265. !       overflow = !possible_sum_sign (hi, int2h, int1h);
  2266.         t = build_int_2 (low, hi);
  2267.         break;
  2268.   
  2269. ***************
  2270. *** 1041,1058 ****
  2271.             t = build_int_2 (int2l, int2h);
  2272.             goto got_it;
  2273.           case 2:
  2274.             temp = int2l + int2l;
  2275. !           int2h = int2h * 2 + (temp < int2l);
  2276.             t = build_int_2 (temp, int2h);
  2277.             goto got_it;
  2278. -         case 3:
  2279. -           temp = int2l + int2l + int2l;
  2280. -           int2h = int2h * 3 + (temp < int2l);
  2281. -           t = build_int_2 (temp, int2h);
  2282. -           goto got_it;
  2283.           case 4:
  2284.             temp = int2l + int2l;
  2285. !           int2h = int2h * 4 + ((temp < int2l) << 1);
  2286.             int2l = temp;
  2287.             temp += temp;
  2288.             int2h += (temp < int2l);
  2289. --- 1094,1108 ----
  2290.             t = build_int_2 (int2l, int2h);
  2291.             goto got_it;
  2292.           case 2:
  2293. +           overflow = left_shift_overflows (int2h, 1);
  2294.             temp = int2l + int2l;
  2295. !           int2h = (int2h << 1) + (temp < int2l);
  2296.             t = build_int_2 (temp, int2h);
  2297.             goto got_it;
  2298.           case 4:
  2299. +           overflow = left_shift_overflows (int2h, 2);
  2300.             temp = int2l + int2l;
  2301. !           int2h = (int2h << 2) + ((temp < int2l) << 1);
  2302.             int2l = temp;
  2303.             temp += temp;
  2304.             int2h += (temp < int2l);
  2305. ***************
  2306. *** 1059,1066 ****
  2307.             t = build_int_2 (temp, int2h);
  2308.             goto got_it;
  2309.           case 8:
  2310.             temp = int2l + int2l;
  2311. !           int2h = int2h * 8 + ((temp < int2l) << 2);
  2312.             int2l = temp;
  2313.             temp += temp;
  2314.             int2h += (temp < int2l) << 1;
  2315. --- 1109,1117 ----
  2316.             t = build_int_2 (temp, int2h);
  2317.             goto got_it;
  2318.           case 8:
  2319. +           overflow = left_shift_overflows (int2h, 3);
  2320.             temp = int2l + int2l;
  2321. !           int2h = (int2h << 3) + ((temp < int2l) << 2);
  2322.             int2l = temp;
  2323.             temp += temp;
  2324.             int2h += (temp < int2l) << 1;
  2325. ***************
  2326. *** 1088,1094 ****
  2327.           }
  2328.           }
  2329.   
  2330. !       mul_double (int1l, int1h, int2l, int2h, &low, &hi);
  2331.         t = build_int_2 (low, hi);
  2332.         break;
  2333.   
  2334. --- 1139,1145 ----
  2335.           }
  2336.           }
  2337.   
  2338. !       overflow = mul_double (int1l, int1h, int2l, int2h, &low, &hi);
  2339.         t = build_int_2 (low, hi);
  2340.         break;
  2341.   
  2342. ***************
  2343. *** 1119,1133 ****
  2344.             t = build_int_2 (1, 0);
  2345.             break;
  2346.           }
  2347. !       div_and_round_double (code, uns, int1l, int1h, int2l, int2h,
  2348. !                 &low, &hi, &garbagel, &garbageh);
  2349.         t = build_int_2 (low, hi);
  2350.         break;
  2351.   
  2352.       case TRUNC_MOD_EXPR: case ROUND_MOD_EXPR: 
  2353.       case FLOOR_MOD_EXPR: case CEIL_MOD_EXPR:
  2354. !       div_and_round_double (code, uns, int1l, int1h, int2l, int2h,
  2355. !                 &garbagel, &garbageh, &low, &hi);
  2356.         t = build_int_2 (low, hi);
  2357.         break;
  2358.   
  2359. --- 1170,1186 ----
  2360.             t = build_int_2 (1, 0);
  2361.             break;
  2362.           }
  2363. !       overflow = div_and_round_double (code, uns,
  2364. !                        int1l, int1h, int2l, int2h,
  2365. !                        &low, &hi, &garbagel, &garbageh);
  2366.         t = build_int_2 (low, hi);
  2367.         break;
  2368.   
  2369.       case TRUNC_MOD_EXPR: case ROUND_MOD_EXPR: 
  2370.       case FLOOR_MOD_EXPR: case CEIL_MOD_EXPR:
  2371. !       overflow = div_and_round_double (code, uns,
  2372. !                        int1l, int1h, int2l, int2h,
  2373. !                        &garbagel, &garbageh, &low, &hi);
  2374.         t = build_int_2 (low, hi);
  2375.         break;
  2376.   
  2377. ***************
  2378. *** 1156,1162 ****
  2379.       }
  2380.       got_it:
  2381.         TREE_TYPE (t) = TREE_TYPE (arg1);
  2382. !       force_fit_type (t);
  2383.         return t;
  2384.       }
  2385.   #if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  2386. --- 1209,1215 ----
  2387.       }
  2388.       got_it:
  2389.         TREE_TYPE (t) = TREE_TYPE (arg1);
  2390. !       force_fit_type (t, overflow);
  2391.         return t;
  2392.       }
  2393.   #if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  2394. ***************
  2395. *** 1171,1177 ****
  2396.         d2 = TREE_REAL_CST (arg2);
  2397.         if (setjmp (float_error))
  2398.       {
  2399. !       warning ("floating overflow in constant folding");
  2400.         return build (code, TREE_TYPE (arg1), arg1, arg2);
  2401.       }
  2402.         set_float_handler (float_error);
  2403. --- 1224,1230 ----
  2404.         d2 = TREE_REAL_CST (arg2);
  2405.         if (setjmp (float_error))
  2406.       {
  2407. !       pedwarn ("floating overflow in constant expression");
  2408.         return build (code, TREE_TYPE (arg1), arg1, arg2);
  2409.       }
  2410.         set_float_handler (float_error);
  2411. ***************
  2412. *** 1363,1369 ****
  2413.         t = build_int_2 (TREE_INT_CST_LOW (arg1),
  2414.                  TREE_INT_CST_HIGH (arg1));
  2415.         TREE_TYPE (t) = type;
  2416. !       force_fit_type (t);
  2417.       }
  2418.   #if !defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  2419.         else if (TREE_CODE (arg1) == REAL_CST)
  2420. --- 1416,1422 ----
  2421.         t = build_int_2 (TREE_INT_CST_LOW (arg1),
  2422.                  TREE_INT_CST_HIGH (arg1));
  2423.         TREE_TYPE (t) = type;
  2424. !       force_fit_type (t, 0);
  2425.       }
  2426.   #if !defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  2427.         else if (TREE_CODE (arg1) == REAL_CST)
  2428. ***************
  2429. *** 1375,1381 ****
  2430.         if (! ((REAL_VALUES_LESS (l, x) || REAL_VALUES_EQUAL (l, x))
  2431.            && (REAL_VALUES_LESS (x, u) || REAL_VALUES_EQUAL (x, u))))
  2432.           {
  2433. !           warning ("real constant out of range for integer conversion");
  2434.             return t;
  2435.           }
  2436.   #ifndef REAL_ARITHMETIC
  2437. --- 1428,1434 ----
  2438.         if (! ((REAL_VALUES_LESS (l, x) || REAL_VALUES_EQUAL (l, x))
  2439.            && (REAL_VALUES_LESS (x, u) || REAL_VALUES_EQUAL (x, u))))
  2440.           {
  2441. !           pedwarn ("real constant out of range for integer conversion");
  2442.             return t;
  2443.           }
  2444.   #ifndef REAL_ARITHMETIC
  2445. ***************
  2446. *** 1403,1409 ****
  2447.         }
  2448.   #endif
  2449.         TREE_TYPE (t) = type;
  2450. !       force_fit_type (t);
  2451.       }
  2452.   #endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
  2453.         TREE_TYPE (t) = type;
  2454. --- 1456,1462 ----
  2455.         }
  2456.   #endif
  2457.         TREE_TYPE (t) = type;
  2458. !       force_fit_type (t, 0);
  2459.       }
  2460.   #endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
  2461.         TREE_TYPE (t) = type;
  2462. ***************
  2463. *** 1418,1424 ****
  2464.       {
  2465.         if (setjmp (float_error))
  2466.           {
  2467. !           warning ("floating overflow in constant folding");
  2468.             return t;
  2469.           }
  2470.         set_float_handler (float_error);
  2471. --- 1471,1477 ----
  2472.       {
  2473.         if (setjmp (float_error))
  2474.           {
  2475. !           pedwarn ("floating overflow in constant expression");
  2476.             return t;
  2477.           }
  2478.         set_float_handler (float_error);
  2479. ***************
  2480. *** 2803,2809 ****
  2481.           {
  2482.             t = build_int_2 (TREE_STRING_POINTER (arg0)[i], 0);
  2483.             TREE_TYPE (t) = TREE_TYPE (TREE_TYPE (arg0));
  2484. !           force_fit_type (t);
  2485.           }
  2486.       }
  2487.         return t;
  2488. --- 2856,2862 ----
  2489.           {
  2490.             t = build_int_2 (TREE_STRING_POINTER (arg0)[i], 0);
  2491.             TREE_TYPE (t) = TREE_TYPE (TREE_TYPE (arg0));
  2492. !           force_fit_type (t, 0);
  2493.           }
  2494.       }
  2495.         return t;
  2496. ***************
  2497. *** 2818,2830 ****
  2498.       {
  2499.         if (TREE_CODE (arg0) == INTEGER_CST)
  2500.           {
  2501. !           if (TREE_INT_CST_LOW (arg0) == 0)
  2502. !         t = build_int_2 (0, - TREE_INT_CST_HIGH (arg0));
  2503. !           else
  2504. !         t = build_int_2 (- TREE_INT_CST_LOW (arg0),
  2505. !                  ~ TREE_INT_CST_HIGH (arg0));
  2506.             TREE_TYPE (t) = type;
  2507. !           force_fit_type (t);
  2508.           }
  2509.         else if (TREE_CODE (arg0) == REAL_CST)
  2510.           t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
  2511. --- 2871,2883 ----
  2512.       {
  2513.         if (TREE_CODE (arg0) == INTEGER_CST)
  2514.           {
  2515. !           int low, high;
  2516. !           int overflow = neg_double (TREE_INT_CST_LOW (arg0),
  2517. !                      TREE_INT_CST_HIGH (arg0),
  2518. !                      &low, &high);
  2519. !           t = build_int_2 (low, high);
  2520.             TREE_TYPE (t) = type;
  2521. !           force_fit_type (t, overflow);
  2522.           }
  2523.         else if (TREE_CODE (arg0) == REAL_CST)
  2524.           t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
  2525. ***************
  2526. *** 2874,2880 ****
  2527.           t = build_int_2 (~ TREE_INT_CST_LOW (arg0),
  2528.                    ~ TREE_INT_CST_HIGH (arg0));
  2529.         TREE_TYPE (t) = type;
  2530. !       force_fit_type (t);
  2531.       }
  2532.         else if (TREE_CODE (arg0) == BIT_NOT_EXPR)
  2533.       return TREE_OPERAND (arg0, 0);
  2534. --- 2927,2933 ----
  2535.           t = build_int_2 (~ TREE_INT_CST_LOW (arg0),
  2536.                    ~ TREE_INT_CST_HIGH (arg0));
  2537.         TREE_TYPE (t) = type;
  2538. !       force_fit_type (t, 0);
  2539.       }
  2540.         else if (TREE_CODE (arg0) == BIT_NOT_EXPR)
  2541.       return TREE_OPERAND (arg0, 0);
  2542. *** 1.3    1992/06/11 23:40:40
  2543. --- function.c    1992/10/09 20:09:38
  2544. ***************
  2545. *** 2396,2401 ****
  2546. --- 2396,2419 ----
  2547.     return get_insns ();
  2548.   }
  2549.   
  2550. + /* Return the first insn which follows the given INSN and which is a
  2551. +    NOTE_INSN_BLOCK_BEG, or else just return the given INSN if there is
  2552. +    no following NOTE_INSN_BLOCK_BEG.  */
  2553. + rtx
  2554. + get_first_following_block_beg (insn)
  2555. +      register rtx insn;
  2556. + {
  2557. +   register rtx searcher;
  2558. +   for (searcher = insn; searcher; searcher = NEXT_INSN (searcher))
  2559. +     if (GET_CODE (searcher) == NOTE
  2560. +     && NOTE_LINE_NUMBER (searcher) == NOTE_INSN_BLOCK_BEG)
  2561. +       return searcher;
  2562. +   return insn;
  2563. + }
  2564.   /* Return 1 if EXP returns an aggregate value, for which an address
  2565.      must be passed to the function or returned by the function.  */
  2566.   
  2567. *** 1.13    1992/08/14 15:10:24
  2568. --- gcc.c    1992/10/09 20:09:41
  2569. ***************
  2570. *** 429,437 ****
  2571.           -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
  2572.       %{!undef:%{!ansi:%p} %P} %{trigraphs}\
  2573.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2574. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2575. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2576. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2577.           %{traditional-cpp:-traditional}\
  2578.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2579.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n\
  2580. --- 429,434 ----
  2581. ***************
  2582. *** 452,460 ****
  2583.           -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
  2584.       %{!undef:%{!ansi:%p} %P} %{trigraphs}\
  2585.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2586. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2587. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2588. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2589.           %{traditional-cpp:-traditional}\
  2590.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2591.           %i %W{o*}}\
  2592. --- 449,454 ----
  2593. ***************
  2594. *** 467,475 ****
  2595.           -undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
  2596.       %{!undef:%{!ansi:%p} %P} %{trigraphs}\
  2597.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2598. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2599. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2600. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2601.           %{traditional-cpp:-traditional}\
  2602.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2603.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n\
  2604. --- 461,466 ----
  2605. ***************
  2606. *** 493,501 ****
  2607.           -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
  2608.       %{!undef:%{!ansi:%p} %P} %{trigraphs}\
  2609.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2610. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2611. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2612. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2613.           %{traditional-cpp:-traditional}\
  2614.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2615.           %i %W{o*}"},
  2616. --- 484,489 ----
  2617. ***************
  2618. *** 509,517 ****
  2619.       -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \
  2620.       %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
  2621.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2622. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2623. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2624. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2625.           %{traditional-cpp:-traditional} %{trigraphs}\
  2626.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2627.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n\
  2628. --- 497,502 ----
  2629. ***************
  2630. *** 551,556 ****
  2631. --- 536,543 ----
  2632.      "%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a \
  2633.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i %A\n }"},
  2634.     {".S", "@assembler-with-cpp"},
  2635. +   {".ss", "@assembler-with-cpp"},
  2636. +   {".cpp", "@assembler-with-cpp"},
  2637.     {"@assembler-with-cpp",
  2638.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\
  2639.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  2640. ***************
  2641. *** 557,565 ****
  2642.       %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \
  2643.           -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \
  2644.           %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
  2645. -         %{mshort:-D__MSHORT__} %{mint:-D__MINT__}\
  2646. -         %{m68881:-D__M68881__} %{m68020:-D__M68020__}\
  2647. -         %{mc68881:-D__M68881__} %{mc68020:-D__M68020__}\
  2648.           %{traditional-cpp:-traditional}\
  2649.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\
  2650.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n\
  2651. --- 544,549 ----
  2652. *** 1.1    1992/03/23 14:55:41
  2653. --- integrate.h    1992/10/09 20:09:50
  2654. ***************
  2655. *** 70,76 ****
  2656.        of each entry in const_equiv_map.
  2657.        A value of -1 indicates an entry for a reg which is a parm.
  2658.        All other values are "positive".  */
  2659. ! #define CONST_AGE_PARM (-1)
  2660.     unsigned int const_age;
  2661.     /* In parallel with const_equiv_map, record the valid age for each entry.
  2662.        The entry is invalid if its age is less than const_age.  */
  2663. --- 70,76 ----
  2664.        of each entry in const_equiv_map.
  2665.        A value of -1 indicates an entry for a reg which is a parm.
  2666.        All other values are "positive".  */
  2667. ! #define CONST_AGE_PARM ((unsigned) -1)
  2668.     unsigned int const_age;
  2669.     /* In parallel with const_equiv_map, record the valid age for each entry.
  2670.        The entry is invalid if its age is less than const_age.  */
  2671. *** 1.2    1992/06/11 23:40:40
  2672. --- print-rtl.c    1992/10/09 20:10:04
  2673. ***************
  2674. *** 232,234 ****
  2675. --- 232,241 ----
  2676.       print_rtx (rtx_first);
  2677.         }
  2678.   }
  2679. + void
  2680. + debug_rtl (rtx_first)
  2681. +      rtx rtx_first;
  2682. + {
  2683. +   print_rtl (stderr, rtx_first);
  2684. + }
  2685. *** 1.2    1992/06/11 23:40:40
  2686. --- print-tree.c    1992/10/09 20:10:04
  2687. ***************
  2688. *** 193,199 ****
  2689.         return;
  2690.       }
  2691.   
  2692. !   hash = ((int) node & ~(1 << (HOST_BITS_PER_INT - 1))) % HASH_SIZE;
  2693.   
  2694.     /* If node is in the table, just mention its address.  */
  2695.     for (b = table[hash]; b; b = b->next)
  2696. --- 193,199 ----
  2697.         return;
  2698.       }
  2699.   
  2700. !   hash = (unsigned) node % HASH_SIZE;
  2701.   
  2702.     /* If node is in the table, just mention its address.  */
  2703.     for (b = table[hash]; b; b = b->next)
  2704. *** 1.4    1992/06/11 23:40:40
  2705. --- stmt.c    1992/10/09 20:10:22
  2706. ***************
  2707. *** 56,61 ****
  2708. --- 56,64 ----
  2709.   
  2710.   extern int xmalloc ();
  2711.   extern void free ();
  2712. + extern struct binding_level *current_memorable_context ();
  2713. + extern void push_old_context ();
  2714. + extern void pop_old_context ();
  2715.   
  2716.   /* Filename and line number of last line-number note,
  2717.      whether we actually emitted it or not.  */
  2718. ***************
  2719. *** 181,187 ****
  2720.   void fixup_gotos ();
  2721.   void free_temp_slots ();
  2722.   static void expand_cleanups ();
  2723. - static void fixup_cleanups ();
  2724.   static void expand_null_return_1 ();
  2725.   static int tail_recursion_args ();
  2726.   static void do_jump_if_equal ();
  2727. --- 184,189 ----
  2728. ***************
  2729. *** 387,392 ****
  2730. --- 389,401 ----
  2731.     /* The LABEL_DECL that this jump is jumping to, or 0
  2732.        for break, continue or return.  */
  2733.     tree target;
  2734. +   /* A pointer to a structure (defined elsewhere) which represents the
  2735. +      lexical context within which the goto occured.  We must restore this
  2736. +      context before we actually expand any of the cleanups associated with
  2737. +      the goto in order to make the debugging information come out right.
  2738. +      Note that this field has to be filled in by a routine provided by the
  2739. +      front-end.  */
  2740. +   struct binding_level *context;
  2741.     /* The CODE_LABEL rtx that this is jumping to.  */
  2742.     rtx target_rtl;
  2743.     /* Number of binding contours started in current function
  2744. ***************
  2745. *** 818,823 ****
  2746. --- 827,833 ----
  2747.         fixup->before_jump = last_insn ? last_insn : get_last_insn ();
  2748.         fixup->target = tree_label;
  2749.         fixup->target_rtl = rtl_label;
  2750. +       fixup->context = current_memorable_context ();
  2751.         fixup->block_start_count = block_start_count;
  2752.         fixup->stack_level = 0;
  2753.         fixup->cleanup_list_list
  2754. ***************
  2755. *** 878,883 ****
  2756. --- 888,895 ----
  2757.        If so, we can finalize it.  */
  2758.         else if (PREV_INSN (f->target_rtl) != 0)
  2759.       {
  2760. +       register rtx cleanup_insns;
  2761.         /* Get the first non-label after the label
  2762.            this goto jumps to.  If that's before this scope begins,
  2763.            we don't have a jump into the scope.  */
  2764. ***************
  2765. *** 906,912 ****
  2766.             TREE_REGDECL (f->target) = 1;
  2767.           }
  2768.   
  2769. !       /* Execute cleanups for blocks this jump exits.  */
  2770.         if (f->cleanup_list_list)
  2771.           {
  2772.             tree lists;
  2773. --- 918,943 ----
  2774.             TREE_REGDECL (f->target) = 1;
  2775.           }
  2776.   
  2777. !       /* Setup the same lexical context as was in effect at the point of
  2778. !          the `goto', `continue', `break', or `return' itself.  We need
  2779. !          to do this in order to handle the possibility that the cleanups
  2780. !          we are about to generate (for this jump) involve some inline
  2781. !          expansions of functions (as can occur when the cleanups are
  2782. !          calls to C++ object destructors which were declared `inline').
  2783. !          In such cases, we want the nesting of any BLOCK nodes generated
  2784. !          for the inlinings to be "correct" so that the *out.c files (i.e.
  2785. !          the debug info production files) will generate the right info
  2786. !          later on.  */
  2787. !       push_old_context (f->context);
  2788. !       /* We will expand the cleanups into a sequence of their own and
  2789. !          then later on we will attach this new sequence to the insn
  2790. !          stream just ahead of the actual jump insn.  */
  2791. !       start_sequence ();
  2792. !       /* Expand the cleanups for blocks this jump exits.  */
  2793.         if (f->cleanup_list_list)
  2794.           {
  2795.             tree lists;
  2796. ***************
  2797. *** 915,921 ****
  2798.              Do their cleanups.  */
  2799.           if (TREE_ADDRESSABLE (lists)
  2800.               && TREE_VALUE (lists) != 0)
  2801. !           fixup_cleanups (TREE_VALUE (lists), &f->before_jump);
  2802.           }
  2803.   
  2804.         /* Restore stack level for the biggest contour that this
  2805. --- 946,957 ----
  2806.              Do their cleanups.  */
  2807.           if (TREE_ADDRESSABLE (lists)
  2808.               && TREE_VALUE (lists) != 0)
  2809. !           {
  2810. !             expand_cleanups (TREE_VALUE (lists), 0);
  2811. !             /* Pop any pushes done in the cleanups,
  2812. !                in case function is about to return.  */
  2813. !             do_pending_stack_adjust ();
  2814. !           }
  2815.           }
  2816.   
  2817.         /* Restore stack level for the biggest contour that this
  2818. ***************
  2819. *** 922,927 ****
  2820. --- 958,986 ----
  2821.            jump jumps out of.  */
  2822.         if (f->stack_level)
  2823.           emit_stack_restore (SAVE_BLOCK, f->stack_level, f->before_jump);
  2824. +       /* Finish up the sequence containing the insns which implement the
  2825. +          necessary cleanups, and then attach that whole sequence to the
  2826. +          insn stream just ahead of the actual jump insn.  Attaching it
  2827. +          at that point insures that any cleanups which are in fact
  2828. +          implicit C++ object destructions (which must be executed upon
  2829. +          leaving the block) appear (to the debugger) to be taking place
  2830. +          in an area of the generated code where the object(s) being
  2831. +          destructed are still "in scope".  */
  2832. +       cleanup_insns = get_insns ();
  2833. +       end_sequence ();
  2834. +       emit_insns_after (cleanup_insns, f->before_jump);
  2835. +       /* Now, in case any new lexical blocks were added as a result of
  2836. +          expanding the cleanups (e.g. if one of more of them involved
  2837. +          a function inlining) get the new blocks attached in the right
  2838. +          place to the TREE for this function (so that we later generate
  2839. +          proper debug info for it) and then pop off the temporary lexical
  2840. +          context that we pushed above.  */
  2841. +       pop_old_context ();
  2842.         f->before_jump = 0;
  2843.       }
  2844.       }
  2845. ***************
  2846. *** 2467,2480 ****
  2847.         if (! TREE_USED (decl) && TREE_CODE (decl) == VAR_DECL)
  2848.       warning_with_decl (decl, "unused variable `%s'");
  2849.   
  2850. -   /* Mark the beginning and end of the scope if requested.  */
  2851. -   if (mark_ends)
  2852. -     emit_note (0, NOTE_INSN_BLOCK_END);
  2853. -   else
  2854. -     /* Get rid of the beginning-mark if we don't make an end-mark.  */
  2855. -     NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
  2856.     if (thisblock->exit_label)
  2857.       {
  2858.         do_pending_stack_adjust ();
  2859. --- 2526,2531 ----
  2860. ***************
  2861. *** 2636,2641 ****
  2862. --- 2687,2700 ----
  2863.              dont_jump_in);
  2864.       }
  2865.   
  2866. +   /* Mark the beginning and end of the scope if requested.  */
  2867. +   if (mark_ends)
  2868. +     emit_note (0, NOTE_INSN_BLOCK_END);
  2869. +   else
  2870. +     /* Get rid of the beginning-mark if we don't make an end-mark.  */
  2871. +     NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
  2872.     /* If doing stupid register allocation, make sure lives of all
  2873.        register variables declared here extend thru end of scope.  */
  2874.   
  2875. ***************
  2876. *** 2992,3024 ****
  2877.           free_temp_slots ();
  2878.         }
  2879.         }
  2880. - }
  2881. - /* Expand a list of cleanups for a goto fixup.
  2882. -    The expansion is put into the insn chain after the insn *BEFORE_JUMP
  2883. -    and *BEFORE_JUMP is set to the insn that now comes before the jump.  */
  2884. - static void
  2885. - fixup_cleanups (list, before_jump)
  2886. -      tree list;
  2887. -      rtx *before_jump;
  2888. - {
  2889. -   rtx beyond_jump = get_last_insn ();
  2890. -   rtx new_before_jump;
  2891. -   expand_cleanups (list, 0);
  2892. -   /* Pop any pushes done in the cleanups,
  2893. -      in case function is about to return.  */
  2894. -   do_pending_stack_adjust ();
  2895. -   new_before_jump = get_last_insn ();
  2896. -   if (beyond_jump != new_before_jump)
  2897. -     {
  2898. -       /* If cleanups expand to nothing, don't reorder.  */
  2899. -       reorder_insns (NEXT_INSN (beyond_jump), new_before_jump, *before_jump);
  2900. -       *before_jump = new_before_jump;
  2901. -     }
  2902.   }
  2903.   
  2904.   /* Move all cleanups from the current block_stack
  2905. --- 3051,3056 ----
  2906. *** 1.9    1992/06/12 05:28:49
  2907. --- toplev.c    1992/10/09 20:10:29
  2908. ***************
  2909. *** 70,79 ****
  2910.       /* -1 means malloc from own heap and keep all  of memory */
  2911.   #endif /* atarist */
  2912.   
  2913. - #if (defined(atarist) || defined(atariminix))
  2914. - #include "astab.h"    /* need this for ASM_OUTPUT_SOURCE_FILENAME */
  2915. - #endif
  2916.   #ifdef VMS
  2917.   /* The extra parameters substantially improve the I/O performance.  */
  2918.   static FILE *
  2919. --- 70,75 ----
  2920. ***************
  2921. *** 1309,1314 ****
  2922. --- 1305,1311 ----
  2923.       name[len - 4] = 0;
  2924.   }
  2925.   
  2926. + #ifdef SYSV
  2927.   /* Output a file name in the form wanted by System V.  */
  2928.   
  2929.   void
  2930. ***************
  2931. *** 1337,1342 ****
  2932. --- 1334,1340 ----
  2933.   #endif
  2934.   #endif
  2935.   }
  2936. + #endif
  2937.   
  2938.   /* Compile an entire file of output from cpp, named NAME.
  2939.      Write a file of assembly output and various debugging dumps.  */
  2940. ***************
  2941. *** 2028,2033 ****
  2942. --- 2026,2035 ----
  2943.   #ifdef SDB_DEBUGGING_INFO
  2944.     if (write_symbols == SDB_DEBUG)
  2945.       TIMEVAR (symout_time, sdbout_symbol (TYPE_STUB_DECL (type), !toplev));
  2946. + #endif
  2947. + #ifdef DWARF_DEBUGGING_INFO
  2948. +   if (write_symbols == DWARF_DEBUG && toplev)
  2949. +     TIMEVAR (symout_time, dwarfout_file_scope_decl (TYPE_STUB_DECL (type), 0));
  2950.   #endif
  2951.   }
  2952.   
  2953. *** 1.3    1992/06/11 23:40:40
  2954. --- tree.h    1992/10/09 20:10:30
  2955. ***************
  2956. *** 218,225 ****
  2957.      implicitly and should not lead to an "unused value" warning.  */
  2958.   #define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag)
  2959.   
  2960. ! /* In a NON_LVALUE_EXPR, this means there was overflow in folding.
  2961. !    The folded constant is inside the NON_LVALUE_EXPR.  */
  2962.   #define TREE_CONSTANT_OVERFLOW(NODE) ((NODE)->common.static_flag)
  2963.   
  2964.   /* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation
  2965. --- 218,224 ----
  2966.      implicitly and should not lead to an "unused value" warning.  */
  2967.   #define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag)
  2968.   
  2969. ! /* In an INTEGER_CST, this means there was overflow in folding.  */
  2970.   #define TREE_CONSTANT_OVERFLOW(NODE) ((NODE)->common.static_flag)
  2971.   
  2972.   /* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation
  2973. *** 1.4    1992/06/11 23:40:40
  2974. --- unroll.c    1992/10/09 20:10:31
  2975. ***************
  2976. *** 1661,1667 ****
  2977.             int regno = REGNO (SET_DEST (pattern));
  2978.   
  2979.             if (map->const_age_map[regno] == map->const_age)
  2980. !         map->const_age_map[regno] = -1;
  2981.           }
  2982.         break;
  2983.         
  2984. --- 1661,1667 ----
  2985.             int regno = REGNO (SET_DEST (pattern));
  2986.   
  2987.             if (map->const_age_map[regno] == map->const_age)
  2988. !         map->const_age_map[regno] = CONST_AGE_PARM;
  2989.           }
  2990.         break;
  2991.         
  2992. *** 1.3    1992/06/11 23:40:40
  2993. --- varasm.c    1992/10/09 20:10:33
  2994. ***************
  2995. *** 951,964 ****
  2996.   assemble_external_libcall (fun)
  2997.        rtx fun;
  2998.   {
  2999. - #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  3000.     /* Declare library function name external when first used, if nec.  */
  3001.     if (! SYMBOL_REF_USED (fun))
  3002.       {
  3003.         SYMBOL_REF_USED (fun) = 1;
  3004.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  3005. -     }
  3006.   #endif
  3007.   }
  3008.   
  3009.   /* Declare the label NAME global.  */
  3010. --- 951,964 ----
  3011.   assemble_external_libcall (fun)
  3012.        rtx fun;
  3013.   {
  3014.     /* Declare library function name external when first used, if nec.  */
  3015.     if (! SYMBOL_REF_USED (fun))
  3016.       {
  3017.         SYMBOL_REF_USED (fun) = 1;
  3018. + #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  3019.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  3020.   #endif
  3021. +     }
  3022.   }
  3023.   
  3024.   /* Declare the label NAME global.  */
  3025.